|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|