|
|
@ -36,6 +36,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti |
|
|
|
private UIButton okButton; |
|
|
|
private UIButton okButton; |
|
|
|
private UIButton cancelButton; |
|
|
|
private UIButton cancelButton; |
|
|
|
private JDialog dialog; |
|
|
|
private JDialog dialog; |
|
|
|
|
|
|
|
private UILabel uiLabel; |
|
|
|
|
|
|
|
|
|
|
|
// Database pane
|
|
|
|
// Database pane
|
|
|
|
public DatabaseConnectionPane() { |
|
|
|
public DatabaseConnectionPane() { |
|
|
@ -46,6 +47,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti |
|
|
|
originalCharSetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); |
|
|
|
originalCharSetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); |
|
|
|
newCharSetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); |
|
|
|
newCharSetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); |
|
|
|
message = new UILabel(); |
|
|
|
message = new UILabel(); |
|
|
|
|
|
|
|
uiLabel = new UILabel(); |
|
|
|
okButton = new UIButton(Inter.getLocText("OK")); |
|
|
|
okButton = new UIButton(Inter.getLocText("OK")); |
|
|
|
cancelButton = new UIButton(Inter.getLocText("Cancel")); |
|
|
|
cancelButton = new UIButton(Inter.getLocText("Cancel")); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
@ -113,6 +115,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti |
|
|
|
|
|
|
|
|
|
|
|
ActionListener testConnectionActionListener = new ActionListener() { |
|
|
|
ActionListener testConnectionActionListener = new ActionListener() { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
public void actionPerformed(ActionEvent evt) { |
|
|
|
|
|
|
|
|
|
|
|
// Try the java connection.
|
|
|
|
// Try the java connection.
|
|
|
|
final SwingWorker connectionThread = new SwingWorker() { |
|
|
|
final SwingWorker connectionThread = new SwingWorker() { |
|
|
|
protected Object doInBackground() throws Exception { |
|
|
|
protected Object doInBackground() throws Exception { |
|
|
@ -121,6 +124,11 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti |
|
|
|
boolean connect = DataOperator.getInstance().testConnection(database); |
|
|
|
boolean connect = DataOperator.getInstance().testConnection(database); |
|
|
|
okButton.setEnabled(true); |
|
|
|
okButton.setEnabled(true); |
|
|
|
message.setText(database.connectMessage(connect)); |
|
|
|
message.setText(database.connectMessage(connect)); |
|
|
|
|
|
|
|
if (connect) { |
|
|
|
|
|
|
|
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon")); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); |
|
|
|
|
|
|
|
} |
|
|
|
} catch (Exception exp) { |
|
|
|
} catch (Exception exp) { |
|
|
|
FineLoggerFactory.getLogger().error(exp.getMessage(), exp); |
|
|
|
FineLoggerFactory.getLogger().error(exp.getMessage(), exp); |
|
|
|
} |
|
|
|
} |
|
|
@ -165,7 +173,8 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel upPane = new JPanel(); |
|
|
|
JPanel upPane = new JPanel(); |
|
|
|
JPanel downPane = new JPanel(); |
|
|
|
JPanel downPane = new JPanel(); |
|
|
|
UILabel uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon")); |
|
|
|
uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon")); |
|
|
|
|
|
|
|
|
|
|
|
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); |
|
|
|
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); |
|
|
|
upPane.add(uiLabel); |
|
|
|
upPane.add(uiLabel); |
|
|
|
upPane.add(message); |
|
|
|
upPane.add(message); |
|
|
|