|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
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.ExtraDesignClassManager; |
|
|
|
|
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 cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); |
|
|
|
|
private UILabel uiLabel = new UILabel(); |
|
|
|
|
private final int FIRST_COL_WIDTH = 72; |
|
|
|
|
private final int SECOND_COL_WIDTH = 68; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 是否启用 https 勾选框 |
|
|
|
@ -251,50 +257,22 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
|
|
|
|
|
public RemoteEnvPane() { |
|
|
|
|
// 配置内容面板
|
|
|
|
|
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()); |
|
|
|
|
configPanel.setBorder( |
|
|
|
|
BorderFactory.createCompoundBorder( |
|
|
|
|
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); |
|
|
|
|
certPathLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
|
certSecretKeyLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
|
|
|
|
|
|
packConfigPanel(configPanel); |
|
|
|
|
|
|
|
|
|
// 服务器账号配置
|
|
|
|
|
JPanel accountPanel = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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") |
|
|
|
|
) |
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
accountPanel.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); |
|
|
|
|
packAccountPanel(accountPanel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 测试链接按钮
|
|
|
|
|
JPanel testPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
|
|
|
|
testPanel.setBorder(BorderFactory.createEmptyBorder()); |
|
|
|
|
testPanel.setPreferredSize(new Dimension(437, 20)); |
|
|
|
|
UIButton testConnectionButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_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); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentPanel.add(configPanel, BorderLayout.NORTH); |
|
|
|
|
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(); |
|
|
|
|
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.setPreferredSize(new Dimension(440, 600)); |
|
|
|
|
panel.setPreferredSize(new Dimension(FineUIScale.scale(440), (int) panel.getPreferredSize().getHeight())); |
|
|
|
|
UIScrollPane scrollPane = new UIScrollPane(panel); |
|
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
|
this.add(scrollPane); |
|
|
|
@ -395,43 +374,42 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void packConfigPanel(JPanel configPanel) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 主机名
|
|
|
|
|
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")); |
|
|
|
|
portLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
|
portLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
|
// web应用
|
|
|
|
|
UILabel webAppNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Web_Name")); |
|
|
|
|
webAppNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
|
webAppNameLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
|
// servlet
|
|
|
|
|
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")); |
|
|
|
|
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(); |
|
|
|
|
|
|
|
|
|
JPanel urlPanel = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
|
new Component[][]{ |
|
|
|
|
new Component[]{hostNameLabel, hostNameInput}, |
|
|
|
|
new Component[]{portLabel, portInput}, |
|
|
|
|
new Component[]{webAppNameLabel, webAppNameInput}, |
|
|
|
|
new Component[]{servletNameLabel, servletNameInput}, |
|
|
|
|
new Component[]{remoteEnvURLLabel, remoteEnvURLInput} |
|
|
|
|
new Component[]{remoteServerLabel, hostNameLabel, hostNameInput}, |
|
|
|
|
new Component[]{new UILabel(), portLabel, portInput}, |
|
|
|
|
new Component[]{new UILabel(), webAppNameLabel, webAppNameInput}, |
|
|
|
|
new Component[]{new UILabel(), servletNameLabel, servletNameInput}, |
|
|
|
|
new Component[]{new UILabel(), remoteEnvURLLabel, remoteEnvURLInput} |
|
|
|
|
}, |
|
|
|
|
new double[]{PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED}, |
|
|
|
|
new double[]{PREFERRED, FILL}, |
|
|
|
|
5, |
|
|
|
|
new double[]{FIRST_COL_WIDTH, SECOND_COL_WIDTH, FILL}, |
|
|
|
|
14, |
|
|
|
|
10 |
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(urlPanel, 0, 10); |
|
|
|
|
|
|
|
|
|
JTextPane urlTipsPane = new JTextPane(); |
|
|
|
|
urlTipsPane.setEditable(false); |
|
|
|
|
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() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] rows = new double[]{PREFERRED}; |
|
|
|
|
boolean httpsEnabled = httpsCheckbox.isSelected(); |
|
|
|
|
|
|
|
|
@ -491,13 +468,13 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
|
|
|
|
|
} |
|
|
|
|
JPanel content = TableLayoutHelper.createGapTableLayoutPane( |
|
|
|
|
new Component[][]{ |
|
|
|
|
new Component[]{httpsCheckbox, new JPanel()}, |
|
|
|
|
new Component[]{certPathLabel, httpsCertFileInputPanel}, |
|
|
|
|
new Component[]{certSecretKeyLabel, certSecretKeyInput} |
|
|
|
|
new Component[]{httpsCheckbox, new JPanel(), new UILabel()}, |
|
|
|
|
new Component[]{new UILabel(), certPathLabel, httpsCertFileInputPanel}, |
|
|
|
|
new Component[]{new UILabel(), certSecretKeyLabel, certSecretKeyInput} |
|
|
|
|
}, |
|
|
|
|
rows, |
|
|
|
|
new double[]{PREFERRED, FILL}, |
|
|
|
|
5, |
|
|
|
|
new double[]{FIRST_COL_WIDTH, SECOND_COL_WIDTH, FILL}, |
|
|
|
|
14, |
|
|
|
|
10 |
|
|
|
|
); |
|
|
|
|
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")); |
|
|
|
|
userNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); |
|
|
|
|
userNameLabel.setHorizontalAlignment(SwingConstants.LEFT); |
|
|
|
|
// 密码
|
|
|
|
|
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() { |
|
|
|
@ -527,42 +507,25 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
Component[][] accountComponents = new Component[][]{ |
|
|
|
|
new Component[]{userNameLabel, usernameInput}, |
|
|
|
|
new Component[]{passwordLabel, passwordInput} |
|
|
|
|
new Component[]{accountLabel, userNameLabel, usernameInput}, |
|
|
|
|
new Component[]{new UILabel(), passwordLabel, passwordInput}, |
|
|
|
|
new Component[]{new UILabel(), new UILabel(), rememberPwdCheckbox} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
JPanel content = TableLayoutHelper.createGapTableLayoutPane(accountComponents, |
|
|
|
|
new double[]{PREFERRED, PREFERRED}, |
|
|
|
|
new double[]{PREFERRED, FILL}, |
|
|
|
|
5, |
|
|
|
|
new double[]{PREFERRED, PREFERRED, PREFERRED}, |
|
|
|
|
new double[]{FIRST_COL_WIDTH, SECOND_COL_WIDTH, FILL}, |
|
|
|
|
14, |
|
|
|
|
10 |
|
|
|
|
); |
|
|
|
|
TableLayoutHelper.modifyTableLayoutIndexVGap(content, 0, 10); |
|
|
|
|
|
|
|
|
|
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() { |
|
|
|
|
JPanel inputPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
|
inputPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
inputPanel.add(certPathInput, BorderLayout.CENTER); |
|
|
|
|
inputPanel.add(fileChooserButton, BorderLayout.EAST); |
|
|
|
|
fileChooserButton.setPreferredSize(new Dimension(20, 20)); |
|
|
|
|
fileChooserButton.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
|