diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java index 683437b184..7784aa5712 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/AdvancePane.java @@ -39,7 +39,7 @@ public class AdvancePane extends BasicPane { double p = TableLayout.PREFERRED; DBCP_VALIDATION_QUERY.setColumns(20); double[] rowSizeDbcp = {p, p, p, p}; - double[] columnDbcp = {200, p}; + double[] columnDbcp = {190, p}; Component[][] comps = { {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Active") + ":", SwingConstants.RIGHT), DBCP_MAX_ACTIVE}, {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Validation_Query") + ":", SwingConstants.RIGHT), DBCP_VALIDATION_QUERY}, diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java index 5e31220852..9a870d07d2 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java @@ -59,13 +59,13 @@ public class SshPane extends BasicPane { } private UICheckBox usingSsh = new UICheckBox(i18nText("Fine-Design_Basic_Ssh_Using")); - private NotNegativeIntegerEditor port = new NotNegativeIntegerEditor(); - private UITextField ip = new UITextField(); + private NotNegativeIntegerEditor port = new NotNegativeIntegerEditor(20); + private UITextField ip = new UITextField(20); private UIComboBox type = new UIComboBox(); - private UITextField user = new UITextField(); + private UITextField user = new UITextField(20); private JPasswordField password = new UIPasswordFieldWithFixedLength(20); private JPasswordField secret = new UIPasswordFieldWithFixedLength(20); - private KeyFileUITextField keyPath = new KeyFileUITextField(); + private KeyFileUITextField keyPath = new KeyFileUITextField(18); private JPanel contextPane; private Component[][] passwordComps; private Component[][] keyComps; @@ -73,7 +73,7 @@ public class SshPane extends BasicPane { private double f = TableLayout.FILL; private JPanel jPanel; private UIButton fileChooserButton = new UIButton(); - private double[] columnSize = new double[]{208, p}; + private double[] columnSize = new double[]{195, p}; public SshPane() { fileChooserButton.setIcon(new ImageIcon(UIConstants.ACCESSIBLE_EDITOR_DOT)); @@ -82,13 +82,10 @@ public class SshPane extends BasicPane { typeMap.keySet().forEach(key -> type.addItem(key)); type.setSelectedItem(typeMap.inverse().get(SshType.KEY)); jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - keyPath.setColumns(18); fileChooserButton.setPreferredSize(new Dimension(20, 20)); type.setEditable(false); type.setSelectedItem(Toolkit.i18nText("Fine-Design_Basic_Ssh_Private_Key")); - JPanel filePanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); - filePanel.add(keyPath); - filePanel.add(fileChooserButton); + JPanel filePanel = TableLayoutHelper.createCommonTableLayoutPane(new Component[][]{{keyPath, fileChooserButton}}, new double[]{p}, new double[]{f, 20}, 0); Component[] compIp = {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Host") + ":", SwingConstants.RIGHT), ip}; Component[] compPort = {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Port") + ":", SwingConstants.RIGHT), port}; Component[] compUserName = {new UILabel(Toolkit.i18nText("Fine-Design_Report_UserName") + ":", SwingConstants.RIGHT), user}; @@ -247,6 +244,12 @@ public class SshPane extends BasicPane { private static final String PREFIX = ProjectConstants.RESOURCES_NAME + "/"; private static final String UPPER = ".."; + public KeyFileUITextField(int columns) { + this(); + this.setColumns(columns); + } + + public KeyFileUITextField() { super(); this.addKeyListener(new KeyAdapter() { @@ -290,6 +293,8 @@ public class SshPane extends BasicPane { // 设置的时候,不为空,说明文件指定了(文件需要是resource下),替换掉前缀 if (!StringUtils.isEmpty(text) && text.startsWith(PREFIX)) { super.setText(text.replaceFirst(PREFIX, "")); + } else { + super.setText(text); } } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java index 801c441443..e15c44102d 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java @@ -41,20 +41,20 @@ import static com.fr.design.i18n.Toolkit.i18nText; */ public class SslPane extends BasicPane { UICheckBox usingSsl = new UICheckBox(i18nText("Fine-Design_Basic_Ssl_Using")); - private KeyFileUITextField keyPathCa = new KeyFileUITextField(); + private KeyFileUITextField keyPathCa = new KeyFileUITextField(18); private UIButton fileChooserButtonCa = new UIButton(); - private KeyFileUITextField keyPathClientCert = new KeyFileUITextField(); + private KeyFileUITextField keyPathClientCert = new KeyFileUITextField(18); private UIButton fileChooserButtonClientCert = new UIButton(); - private KeyFileUITextField keyPathClientKey = new KeyFileUITextField(); + private KeyFileUITextField keyPathClientKey = new KeyFileUITextField(18); private UIButton fileChooserButtonClientKey = new UIButton(); private UICheckBox verifyCa = new UICheckBox(i18nText("Fine-Design_Basic_Ssl_Verify_Ca")); - private UITextField cipher = new UITextField(); + private UITextField cipher = new UITextField(20); private JPanel jPanel; private Component[][] usingComps; private double p = TableLayout.PREFERRED; private double f = TableLayout.FILL; private JPanel contextPane; - private double[] columnSize = new double[]{208, p}; + private double[] columnSize = new double[]{195, p}; public SslPane() { fileChooserButtonCa.setIcon(new ImageIcon(UIConstants.ACCESSIBLE_EDITOR_DOT)); @@ -64,25 +64,15 @@ public class SslPane extends BasicPane { this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); Dimension dimension = new Dimension(20, 20); - int columns = 18; - keyPathCa.setColumns(columns); fileChooserButtonCa.setPreferredSize(dimension); - keyPathClientCert.setColumns(columns); fileChooserButtonClientCert.setPreferredSize(dimension); fileChooserButtonClientKey.setPreferredSize(dimension); - keyPathClientKey.setColumns(columns); - JPanel filePanelCa = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); - filePanelCa.add(keyPathCa); - filePanelCa.add(fileChooserButtonCa); + JPanel filePanelCa = TableLayoutHelper.createCommonTableLayoutPane(new Component[][]{{keyPathCa, fileChooserButtonCa}}, new double[]{p}, new double[]{f, 20}, 0); Component[] compCa = {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Ca") + ":", SwingConstants.RIGHT), filePanelCa}; Component[] compVerifyCa = {null, verifyCa}; - JPanel filePanelClientCert = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); - filePanelClientCert.add(keyPathClientCert); - filePanelClientCert.add(fileChooserButtonClientCert); + JPanel filePanelClientCert = TableLayoutHelper.createCommonTableLayoutPane(new Component[][]{{keyPathClientCert, fileChooserButtonClientCert}}, new double[]{p}, new double[]{f, 20}, 0); Component[] compClientCert = {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Client_Cert") + ":", SwingConstants.RIGHT), filePanelClientCert}; - JPanel filePanelClientKey = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); - filePanelClientKey.add(keyPathClientKey); - filePanelClientKey.add(fileChooserButtonClientKey); + JPanel filePanelClientKey = TableLayoutHelper.createCommonTableLayoutPane(new Component[][]{{keyPathClientKey, fileChooserButtonClientKey}}, new double[]{p}, new double[]{f, 20}, 0); Component[] compClientKey = {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Client_Key") + ":", SwingConstants.RIGHT), filePanelClientKey}; Component[] comCipher = {new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Cipher") + ":", SwingConstants.RIGHT), cipher}; usingComps = new Component[][]{ diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/NotNegativeIntegerEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/NotNegativeIntegerEditor.java index 7d24a22778..98c59c1736 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/NotNegativeIntegerEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/NotNegativeIntegerEditor.java @@ -11,6 +11,11 @@ import java.awt.event.KeyEvent; public class NotNegativeIntegerEditor extends IntegerEditor { private static final String NEG = "-"; + public NotNegativeIntegerEditor(int columns) { + this(); + this.setColumns(columns); + } + public NotNegativeIntegerEditor() { super(); this.numberField.addKeyListener(new KeyAdapter() {