[Schmitzm-commits] r1294 - trunk/src/skrueger/i8n
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Nov 22 13:00:29 CET 2010
Author: keeb
Date: 2010-11-22 13:00:28 +0100 (Mon, 22 Nov 2010)
New Revision: 1294
Modified:
trunk/src/skrueger/i8n/SwitchLanguageDialog.java
Log:
refactored method such that it overrides getOkButton from superclass for convenience
Modified: trunk/src/skrueger/i8n/SwitchLanguageDialog.java
===================================================================
--- trunk/src/skrueger/i8n/SwitchLanguageDialog.java 2010-11-22 11:55:02 UTC (rev 1293)
+++ trunk/src/skrueger/i8n/SwitchLanguageDialog.java 2010-11-22 12:00:28 UTC (rev 1294)
@@ -70,7 +70,7 @@
private JLabel jLabel = null;
- private JButton jButton = null;
+ private OkButton jButton = null;
private LanguagesComboBox jComboBox = null;
@@ -161,7 +161,7 @@
jContentPane.setLayout(migLayout);
jContentPane.add(jLabelFlagimage, "north");
jContentPane.add(getLanguageCombobox());
- jContentPane.add(getJButton(), // AtlasDialog.getOkButton()
+ jContentPane.add(getOkButton(),
"right, w 50!, gaptop 5, gapright 5, gapbottom 5");
}
return jContentPane;
@@ -172,7 +172,8 @@
*
* @return javax.swing.JButton
*/
- private JButton getJButton() {
+ @Override
+ protected OkButton getOkButton() {
if (jButton == null) {
jButton = new OkButton();
jButton.setEnabled(false);
@@ -187,6 +188,7 @@
}
return jButton;
}
+
/**
* This method initializes the JPanel that carries the select language
* combobox
@@ -223,7 +225,7 @@
public void actionPerformed(final ActionEvent e) {
if (jComboBox.getSelectedIndex() == languages.size()) {
- getJButton().setEnabled(false);
+ getOkButton().setEnabled(false);
return;
}
@@ -231,10 +233,10 @@
try {
Translation.setActiveLang(l, setLocale);
- getJButton().setEnabled(true);
+ getOkButton().setEnabled(true);
} catch (java.lang.IllegalArgumentException ee) {
LOGGER.warn("The language " + l + " is not valid", ee);
- getJButton().setEnabled(false);
+ getOkButton().setEnabled(false);
}
}
More information about the Schmitzm-commits
mailing list