|
|
@ -1,5 +1,8 @@ |
|
|
|
package com.fr.env; |
|
|
|
package com.fr.env; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIUtils; |
|
|
|
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
@ -76,6 +79,9 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> { |
|
|
|
private UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); |
|
|
|
private UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); |
|
|
|
private UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); |
|
|
|
private UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); |
|
|
|
private UILabel uiLabel = new UILabel(); |
|
|
|
private UILabel uiLabel = new UILabel(); |
|
|
|
|
|
|
|
private final int FIRST_COL_WIDTH = 72; |
|
|
|
|
|
|
|
private final int SECOND_COL_WIDTH = 68; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否启用 https 勾选框 |
|
|
|
* 是否启用 https 勾选框 |
|
|
@ -251,50 +257,22 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> { |
|
|
|
public RemoteEnvPane() { |
|
|
|
public RemoteEnvPane() { |
|
|
|
// 配置内容面板
|
|
|
|
// 配置内容面板
|
|
|
|
JPanel contentPanel = new JPanel(new BorderLayout()); |
|
|
|
JPanel contentPanel = new JPanel(new BorderLayout()); |
|
|
|
contentPanel.setBorder( |
|
|
|
|
|
|
|
BorderFactory.createCompoundBorder( |
|
|
|
|
|
|
|
new EmptyBorder(6, 0, 0, 0), |
|
|
|
|
|
|
|
UITitledBorder.createBorderWithTitle(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Config"))) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 服务器地址地址
|
|
|
|
// 服务器地址地址
|
|
|
|
final JPanel configPanel = new JPanel(new BorderLayout()); |
|
|
|
final JPanel configPanel = new JPanel(new BorderLayout()); |
|
|
|
configPanel.setBorder( |
|
|
|
certPathLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
BorderFactory.createCompoundBorder( |
|
|
|
certSecretKeyLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
new EmptyBorder(15, 0, 0, 0), |
|
|
|
|
|
|
|
BorderFactory.createTitledBorder( |
|
|
|
|
|
|
|
new ModLineBorder(ModLineBorder.TOP), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Server") |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
certPathLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
|
|
|
|
certSecretKeyLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
packConfigPanel(configPanel); |
|
|
|
packConfigPanel(configPanel); |
|
|
|
|
|
|
|
|
|
|
|
// 服务器账号配置
|
|
|
|
// 服务器账号配置
|
|
|
|
JPanel accountPanel = new JPanel(new BorderLayout()); |
|
|
|
JPanel accountPanel = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
accountPanel.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); |
|
|
|
|
|
|
|
|
|
|
|
accountPanel.setBorder(BorderFactory.createCompoundBorder( |
|
|
|
|
|
|
|
new EmptyBorder(15, 0, 0, 0), |
|
|
|
|
|
|
|
BorderFactory.createTitledBorder( |
|
|
|
|
|
|
|
new ModLineBorder(ModLineBorder.TOP), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Platform_Account") |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
packAccountPanel(accountPanel); |
|
|
|
packAccountPanel(accountPanel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 测试链接按钮
|
|
|
|
// 测试链接按钮
|
|
|
|
JPanel testPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
|
|
|
JPanel testPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
|
|
|
testPanel.setBorder(BorderFactory.createEmptyBorder()); |
|
|
|
testPanel.setBorder(BorderFactory.createEmptyBorder()); |
|
|
|
testPanel.setPreferredSize(new Dimension(437, 20)); |
|
|
|
|
|
|
|
UIButton testConnectionButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Test_Connection")); |
|
|
|
UIButton testConnectionButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Test_Connection")); |
|
|
|
|
|
|
|
|
|
|
|
testConnectionButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection")); |
|
|
|
testConnectionButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection")); |
|
|
@ -306,14 +284,15 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> { |
|
|
|
}); |
|
|
|
}); |
|
|
|
testPanel.add(testConnectionButton); |
|
|
|
testPanel.add(testConnectionButton); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentPanel.add(configPanel, BorderLayout.NORTH); |
|
|
|
contentPanel.add(configPanel, BorderLayout.NORTH); |
|
|
|
contentPanel.add(accountPanel, BorderLayout.CENTER); |
|
|
|
contentPanel.add(accountPanel, BorderLayout.CENTER); |
|
|
|
contentPanel.add(packRememberPwdConfigPanel(), BorderLayout.SOUTH); |
|
|
|
UILabel label = new UILabel(); |
|
|
|
|
|
|
|
FineUIUtils.wrapBoldLabelWithUnderline(label); |
|
|
|
|
|
|
|
contentPanel.add(label, BorderLayout.SOUTH); |
|
|
|
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
panel.add(contentPanel, BorderLayout.NORTH); |
|
|
|
panel.add(FineUIUtils.wrapComponentWithTitle(contentPanel, Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Config")), BorderLayout.NORTH); |
|
|
|
panel.add(testPanel, BorderLayout.CENTER); |
|
|
|
panel.add(testPanel, BorderLayout.CENTER); |
|
|
|
panel.setPreferredSize(new Dimension(440, 600)); |
|
|
|
panel.setPreferredSize(new Dimension(FineUIScale.scale(440), (int) panel.getPreferredSize().getHeight())); |
|
|
|
UIScrollPane scrollPane = new UIScrollPane(panel); |
|
|
|
UIScrollPane scrollPane = new UIScrollPane(panel); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.add(scrollPane); |
|
|
|
this.add(scrollPane); |
|
|
@ -395,43 +374,42 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void packConfigPanel(JPanel configPanel) { |
|
|
|
private void packConfigPanel(JPanel configPanel) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 主机名
|
|
|
|
// 主机名
|
|
|
|
UILabel hostNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Host_IP")); |
|
|
|
UILabel hostNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Host_IP")); |
|
|
|
hostNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
hostNameLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
// 端口
|
|
|
|
// 端口
|
|
|
|
UILabel portLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Port")); |
|
|
|
UILabel portLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Port")); |
|
|
|
portLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
portLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
// web应用
|
|
|
|
// web应用
|
|
|
|
UILabel webAppNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Web_Name")); |
|
|
|
UILabel webAppNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Web_Name")); |
|
|
|
webAppNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
webAppNameLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
// servlet
|
|
|
|
// servlet
|
|
|
|
UILabel servletNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Servlet_Name")); |
|
|
|
UILabel servletNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Servlet_Name")); |
|
|
|
servletNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
servletNameLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
// 主机位置
|
|
|
|
// 主机位置
|
|
|
|
UILabel remoteEnvURLLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_URL")); |
|
|
|
UILabel remoteEnvURLLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_URL")); |
|
|
|
remoteEnvURLLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
remoteEnvURLLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//远程服务器
|
|
|
|
|
|
|
|
UILabel remoteServerLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Server")); |
|
|
|
|
|
|
|
remoteServerLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
|
|
|
|
|
|
|
|
enableSubDocListener(); |
|
|
|
enableSubDocListener(); |
|
|
|
|
|
|
|
|
|
|
|
JPanel urlPanel = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
JPanel urlPanel = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
new Component[][]{ |
|
|
|
new Component[][]{ |
|
|
|
new Component[]{hostNameLabel, hostNameInput}, |
|
|
|
new Component[]{remoteServerLabel, hostNameLabel, hostNameInput}, |
|
|
|
new Component[]{portLabel, portInput}, |
|
|
|
new Component[]{new UILabel(), portLabel, portInput}, |
|
|
|
new Component[]{webAppNameLabel, webAppNameInput}, |
|
|
|
new Component[]{new UILabel(), webAppNameLabel, webAppNameInput}, |
|
|
|
new Component[]{servletNameLabel, servletNameInput}, |
|
|
|
new Component[]{new UILabel(), servletNameLabel, servletNameInput}, |
|
|
|
new Component[]{remoteEnvURLLabel, remoteEnvURLInput} |
|
|
|
new Component[]{new UILabel(), remoteEnvURLLabel, remoteEnvURLInput} |
|
|
|
}, |
|
|
|
}, |
|
|
|
new double[]{PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED}, |
|
|
|
new double[]{PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED}, |
|
|
|
new double[]{PREFERRED, FILL}, |
|
|
|
new double[]{FIRST_COL_WIDTH, SECOND_COL_WIDTH, FILL}, |
|
|
|
5, |
|
|
|
14, |
|
|
|
10 |
|
|
|
10 |
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(urlPanel, 0, 10); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JTextPane urlTipsPane = new JTextPane(); |
|
|
|
JTextPane urlTipsPane = new JTextPane(); |
|
|
|
urlTipsPane.setEditable(false); |
|
|
|
urlTipsPane.setEditable(false); |
|
|
|
urlTipsPane.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Server_Config_Tips")); |
|
|
|
urlTipsPane.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Server_Config_Tips")); |
|
|
@ -482,7 +460,6 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> { |
|
|
|
|
|
|
|
|
|
|
|
private void packHttpsConfigPanel() { |
|
|
|
private void packHttpsConfigPanel() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] rows = new double[]{PREFERRED}; |
|
|
|
double[] rows = new double[]{PREFERRED}; |
|
|
|
boolean httpsEnabled = httpsCheckbox.isSelected(); |
|
|
|
boolean httpsEnabled = httpsCheckbox.isSelected(); |
|
|
|
|
|
|
|
|
|
|
@ -491,13 +468,13 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> { |
|
|
|
} |
|
|
|
} |
|
|
|
JPanel content = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
JPanel content = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
new Component[][]{ |
|
|
|
new Component[][]{ |
|
|
|
new Component[]{httpsCheckbox, new JPanel()}, |
|
|
|
new Component[]{httpsCheckbox, new JPanel(), new UILabel()}, |
|
|
|
new Component[]{certPathLabel, httpsCertFileInputPanel}, |
|
|
|
new Component[]{new UILabel(), certPathLabel, httpsCertFileInputPanel}, |
|
|
|
new Component[]{certSecretKeyLabel, certSecretKeyInput} |
|
|
|
new Component[]{new UILabel(), certSecretKeyLabel, certSecretKeyInput} |
|
|
|
}, |
|
|
|
}, |
|
|
|
rows, |
|
|
|
rows, |
|
|
|
new double[]{PREFERRED, FILL}, |
|
|
|
new double[]{FIRST_COL_WIDTH, SECOND_COL_WIDTH, FILL}, |
|
|
|
5, |
|
|
|
14, |
|
|
|
10 |
|
|
|
10 |
|
|
|
); |
|
|
|
); |
|
|
|
httpsConfigPanel.add(content, BorderLayout.CENTER); |
|
|
|
httpsConfigPanel.add(content, BorderLayout.CENTER); |
|
|
@ -508,10 +485,13 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> { |
|
|
|
|
|
|
|
|
|
|
|
// 用户名
|
|
|
|
// 用户名
|
|
|
|
UILabel userNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Account_Username")); |
|
|
|
UILabel userNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Account_Username")); |
|
|
|
userNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
userNameLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
// 密码
|
|
|
|
// 密码
|
|
|
|
UILabel passwordLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Account_Password")); |
|
|
|
UILabel passwordLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Account_Password")); |
|
|
|
passwordLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
passwordLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel accountLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remotex_Env_Platform_Account")); |
|
|
|
|
|
|
|
accountLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
|
|
|
|
|
|
|
|
//输入密码的时候检测下大写锁定
|
|
|
|
//输入密码的时候检测下大写锁定
|
|
|
|
passwordInput.addMouseListener(new MouseAdapter() { |
|
|
|
passwordInput.addMouseListener(new MouseAdapter() { |
|
|
@ -527,42 +507,25 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
Component[][] accountComponents = new Component[][]{ |
|
|
|
Component[][] accountComponents = new Component[][]{ |
|
|
|
new Component[]{userNameLabel, usernameInput}, |
|
|
|
new Component[]{accountLabel, userNameLabel, usernameInput}, |
|
|
|
new Component[]{passwordLabel, passwordInput} |
|
|
|
new Component[]{new UILabel(), passwordLabel, passwordInput}, |
|
|
|
|
|
|
|
new Component[]{new UILabel(), new UILabel(), rememberPwdCheckbox} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
JPanel content = TableLayoutHelper.createGapTableLayoutPane(accountComponents, |
|
|
|
JPanel content = TableLayoutHelper.createGapTableLayoutPane(accountComponents, |
|
|
|
new double[]{PREFERRED, PREFERRED}, |
|
|
|
new double[]{PREFERRED, PREFERRED, PREFERRED}, |
|
|
|
new double[]{PREFERRED, FILL}, |
|
|
|
new double[]{FIRST_COL_WIDTH, SECOND_COL_WIDTH, FILL}, |
|
|
|
5, |
|
|
|
14, |
|
|
|
10 |
|
|
|
10 |
|
|
|
); |
|
|
|
); |
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(content, 0, 10); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
accountPanel.add(content, BorderLayout.CENTER); |
|
|
|
accountPanel.add(content, BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel packRememberPwdConfigPanel() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
|
|
|
|
new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{rememberPwdCheckbox} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
new double[]{PREFERRED}, |
|
|
|
|
|
|
|
new double[]{PREFERRED}, |
|
|
|
|
|
|
|
5, |
|
|
|
|
|
|
|
10 |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexHGap(panel, 0, 50); |
|
|
|
|
|
|
|
return panel; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel createHttpsCertFileInputPanel() { |
|
|
|
private JPanel createHttpsCertFileInputPanel() { |
|
|
|
JPanel inputPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
JPanel inputPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
inputPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
inputPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
inputPanel.add(certPathInput, BorderLayout.CENTER); |
|
|
|
inputPanel.add(certPathInput, BorderLayout.CENTER); |
|
|
|
inputPanel.add(fileChooserButton, BorderLayout.EAST); |
|
|
|
inputPanel.add(fileChooserButton, BorderLayout.EAST); |
|
|
|
fileChooserButton.setPreferredSize(new Dimension(20, 20)); |
|
|
|
|
|
|
|
fileChooserButton.addActionListener(new ActionListener() { |
|
|
|
fileChooserButton.addActionListener(new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|