Browse Source

REPORT-10263 远程设计权限验收问题6

research/10.0
yaoh.wu 6 years ago
parent
commit
295601fb66
  1. 8
      designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/remote/ui/list/AddedMemberListCellRender.java
  3. 56
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java

8
designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java

@ -1,6 +1,7 @@
package com.fr.design.remote.ui;
import com.fr.design.border.UITitledBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -193,15 +194,16 @@ public class UserManagerPane extends BasicPane {
public UserManagerPane() {
this.setBorder(BorderFactory.createEmptyBorder());
this.setBorder(BorderFactory.createEmptyBorder(0,4,0,4));
this.setLayout(new BorderLayout());
this.add(
TableLayoutHelper.createTableLayoutPane(
TableLayoutHelper.createCommonTableLayoutPane(
new Component[][]{
new Component[]{createLeftPanel(), createRightPanel()}
},
new double[]{TableLayout.FILL},
new double[]{TableLayout.FILL, TableLayout.FILL}
new double[]{TableLayout.FILL, TableLayout.FILL},
LayoutConstants.VGAP_LARGE
),
BorderLayout.CENTER);
}

4
designer-base/src/main/java/com/fr/design/remote/ui/list/AddedMemberListCellRender.java

@ -23,9 +23,9 @@ public class AddedMemberListCellRender extends JPanel implements ListCellRendere
this.setLayout(new FlowLayout(FlowLayout.LEFT));
label = new UILabel();
label.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png"));
label.setPreferredSize(new Dimension(260, 20));
label.setPreferredSize(new Dimension(264, 20));
this.setPreferredSize(new Dimension(this.getPreferredSize().width, 25));
label.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png"));
this.add(label);
this.add(new IconButton());

56
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -11,6 +11,7 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPassWordField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.scrollruler.ModLineBorder;
@ -41,7 +42,6 @@ import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
@ -65,14 +65,14 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
private JDialog dialog;
private UILabel message = new UILabel();
private UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("OK"));
private UIButton cancelButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Cancel"));
private UIButton okButton = new UIButton(Toolkit.i18nText("OK"));
private UIButton cancelButton = new UIButton(Toolkit.i18nText("Cancel"));
private UILabel uiLabel = new UILabel();
/**
* 是否启用 https 勾选框
*/
private UICheckBox httpsCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Enable_Https"));
private UICheckBox httpsCheckbox = new UICheckBox(Toolkit.i18nText("FR-Designer_RemoteEnv_Enable_Https"));
/**
* 主机位置输入框
*/
@ -124,11 +124,11 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
/**
* https 密钥标签
*/
private UILabel certSecretKeyLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Secret_Key"));
private UILabel certSecretKeyLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Secret_Key"));
/**
* https证书路径标签
*/
private UILabel certPathLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Cert_Path"));
private UILabel certPathLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Cert_Path"));
/**
* https 证书路径输入框
*/
@ -207,7 +207,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
contentPanel.setBorder(
BorderFactory.createCompoundBorder(
new EmptyBorder(6, 0, 0, 0),
UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Config")))
UITitledBorder.createBorderWithTitle(Toolkit.i18nText("FR-Designer_RemoteEnv_Config")))
);
@ -218,7 +218,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
new EmptyBorder(15, 0, 0, 0),
BorderFactory.createTitledBorder(
new ModLineBorder(ModLineBorder.TOP),
com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Server")
Toolkit.i18nText("FR-Designer_RemoteEnv_Server")
)
)
);
@ -237,7 +237,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
new EmptyBorder(15, 0, 0, 0),
BorderFactory.createTitledBorder(
new ModLineBorder(ModLineBorder.TOP),
com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Platform_Account")
Toolkit.i18nText("FR-Designer_RemoteEnv_Platform_Account")
)
));
@ -248,9 +248,9 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
JPanel testPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
testPanel.setBorder(BorderFactory.createEmptyBorder());
testPanel.setPreferredSize(new Dimension(437, 20));
UIButton testConnectionButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Test_Connection"));
UIButton testConnectionButton = new UIButton(Toolkit.i18nText("FR-Designer_RemoteEnv_Test_Connection"));
testConnectionButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Datasource-Test_Connection"));
testConnectionButton.setToolTipText(Toolkit.i18nText("Datasource-Test_Connection"));
testConnectionButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
@ -323,19 +323,19 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
// 主机名
UILabel hostNameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Host_IP"));
UILabel hostNameLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Host_IP"));
hostNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
// 端口
UILabel portLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Port"));
UILabel portLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Port"));
portLabel.setHorizontalAlignment(SwingConstants.RIGHT);
// web应用
UILabel webAppNameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Web_Name"));
UILabel webAppNameLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Web_Name"));
webAppNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
// servlet
UILabel servletNameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Servlet_Name"));
UILabel servletNameLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Servlet_Name"));
servletNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
// 主机位置
UILabel remoteEnvURLLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_URL"));
UILabel remoteEnvURLLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_URL"));
remoteEnvURLLabel.setHorizontalAlignment(SwingConstants.RIGHT);
enableSubDocListener();
@ -359,7 +359,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
JTextPane urlTipsPane = new JTextPane();
urlTipsPane.setEditable(false);
urlTipsPane.setText(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Server_Config_Tips"));
urlTipsPane.setText(Toolkit.i18nText("FR-Designer_RemoteEnv_Server_Config_Tips"));
urlTipsPane.setBackground(urlPanel.getBackground());
urlTipsPane.setForeground(TIPS_FONT_COLOR);
@ -373,7 +373,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
JTextPane httpsTipsPane = new JTextPane();
httpsTipsPane.setEditable(false);
httpsTipsPane.setText(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Tips"));
httpsTipsPane.setText(Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Tips"));
httpsTipsPane.setBackground(configPanel.getBackground());
httpsTipsPane.setForeground(TIPS_FONT_COLOR);
@ -441,18 +441,18 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
private void packAccountPanel(JPanel accountPanel) {
// 用户名
UILabel userNameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Account_Username"));
UILabel userNameLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Account_Username"));
userNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
// 密码
UILabel passwordLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Account_Password"));
UILabel passwordLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Account_Password"));
passwordLabel.setHorizontalAlignment(SwingConstants.RIGHT);
//输入密码的时候检测下大写锁定
passwordInput.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
if (Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)) {
passwordInput.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("CapsLock"));
if (java.awt.Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)) {
passwordInput.setToolTipText(Toolkit.i18nText("CapsLock"));
} else {
passwordInput.setToolTipText(null);
}
@ -512,7 +512,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
try {
return WorkContext.getConnector().testConnection(connection);
} catch (AuthException e) {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Auth_Failed"));
message.setText(Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Auth_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
return null;
}
@ -523,16 +523,16 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
okButton.setEnabled(true);
try {
if (get()) {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Successful"));
message.setText(Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Successful"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
} else {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed"));
message.setText(Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
}
} catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed"));
message.setText(Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
}
dialogDownPane.remove(cancelButton);
@ -568,11 +568,11 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
}
private void initMessageDialog() {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Env_Try") + "...");
message.setText(Toolkit.i18nText("Fine-Designer_Basic_Remote_Env_Try") + "...");
message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
okButton.setEnabled(false);
dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(RemoteEnvPane.this), com.fr.design.i18n.Toolkit.i18nText("Datasource-Test_Connection"), true);
dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(RemoteEnvPane.this), Toolkit.i18nText("Datasource-Test_Connection"), true);
dialog.setSize(new Dimension(268, 118));
okButton.setEnabled(false);

Loading…
Cancel
Save