|
|
@ -102,10 +102,13 @@ public class JDBCDefPane extends JPanel { |
|
|
|
private Component[][] partComponents; |
|
|
|
private Component[][] partComponents; |
|
|
|
// 请不要改动dbtype,只应该最后添加
|
|
|
|
// 请不要改动dbtype,只应该最后添加
|
|
|
|
private final String[] dbtype = {"Oracle", "DB2", "SQL Server", "MySQL", "Sybase", "Access", "Derby", "Postgre", "SQLite", "Inceptor", OTHER_DB}; |
|
|
|
private final String[] dbtype = {"Oracle", "DB2", "SQL Server", "MySQL", "Sybase", "Access", "Derby", "Postgre", "SQLite", "Inceptor", OTHER_DB}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JDBCDatabaseConnection jdbcDatabase; |
|
|
|
private JDBCDatabaseConnection jdbcDatabase; |
|
|
|
private boolean needRefresh = true; |
|
|
|
private boolean needRefresh = true; |
|
|
|
|
|
|
|
private UIComboBox driverManageBox; |
|
|
|
|
|
|
|
private ActionLabel driverManageLabel; |
|
|
|
|
|
|
|
private UIComboBox driverLoaderBox; |
|
|
|
|
|
|
|
private HashBiMap<String, String> nameAndRepresent; |
|
|
|
|
|
|
|
|
|
|
|
ActionListener driverListener = new ActionListener() { |
|
|
|
ActionListener driverListener = new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
@ -175,9 +178,6 @@ public class JDBCDefPane extends JPanel { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
private UIComboBox driverManageBox; |
|
|
|
|
|
|
|
private ActionLabel driverManageLabel; |
|
|
|
|
|
|
|
private UIComboBox driverLoaderBox; |
|
|
|
|
|
|
|
ActionListener driverManageListener = new ActionListener() { |
|
|
|
ActionListener driverManageListener = new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
@ -219,7 +219,41 @@ public class JDBCDefPane extends JPanel { |
|
|
|
DatabaseConnectionPane.JDBC.getAdvancedAttrPane().populate(jdbcDatabase); |
|
|
|
DatabaseConnectionPane.JDBC.getAdvancedAttrPane().populate(jdbcDatabase); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
private HashBiMap<String, String> nameAndRepresent; |
|
|
|
|
|
|
|
|
|
|
|
InputMethodListener portInputMethodListener = new InputMethodListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void inputMethodTextChanged(InputMethodEvent event) { |
|
|
|
|
|
|
|
if (null == event.getText()) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
char ch = event.getText().current(); |
|
|
|
|
|
|
|
if (!(ch >= '0' && ch <= '9')) { |
|
|
|
|
|
|
|
event.consume(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void caretPositionChanged(InputMethodEvent event) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DocumentListener updateParaListener = new DocumentListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
updatePara(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
updatePara(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
updatePara(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
public JDBCDefPane() { |
|
|
|
public JDBCDefPane() { |
|
|
|
initMap(); |
|
|
|
initMap(); |
|
|
@ -434,41 +468,6 @@ public class JDBCDefPane extends JPanel { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
InputMethodListener portInputMethodListener = new InputMethodListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void inputMethodTextChanged(InputMethodEvent event) { |
|
|
|
|
|
|
|
if (null == event.getText()) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
char ch = event.getText().current(); |
|
|
|
|
|
|
|
if (!(ch >= '0' && ch <= '9')) { |
|
|
|
|
|
|
|
event.consume(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void caretPositionChanged(InputMethodEvent event) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DocumentListener updateParaListener = new DocumentListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
updatePara(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
updatePara(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
updatePara(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void populate(JDBCDatabaseConnection jdbcDatabase) { |
|
|
|
public void populate(JDBCDatabaseConnection jdbcDatabase) { |
|
|
|
// 单例对象,重新打开的时候并不会新建,但是由于driverloaderbox里面需要是动态内容,因此需要进行刷新动作
|
|
|
|
// 单例对象,重新打开的时候并不会新建,但是由于driverloaderbox里面需要是动态内容,因此需要进行刷新动作
|
|
|
|
initMap(); |
|
|
|
initMap(); |
|
|
|