Browse Source

REPORT-65857 界面调整和bug修复

feature/x
xiqiu 2 years ago
parent
commit
49a778c2e8
  1. 17
      designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java
  2. 12
      designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java
  3. 5
      designer-base/src/main/java/com/fr/design/editor/editor/NotNegativeIntegerEditor.java

17
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;
@ -82,7 +82,6 @@ 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"));
@ -247,6 +246,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 +295,8 @@ public class SshPane extends BasicPane {
// 设置的时候,不为空,说明文件指定了(文件需要是resource下),替换掉前缀
if (!StringUtils.isEmpty(text) && text.startsWith(PREFIX)) {
super.setText(text.replaceFirst(PREFIX, ""));
} else {
super.setText(text);
}
}
}

12
designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java

@ -41,14 +41,14 @@ 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;
@ -64,13 +64,9 @@ 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);

5
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() {

Loading…
Cancel
Save