Skip to content

Commit

Permalink
Bugfixes (focus can be removed from Input-Box, Improved Range-Check, …
Browse files Browse the repository at this point in the history
…etc.)
  • Loading branch information
Clemens82 committed Mar 14, 2011
1 parent b8dca67 commit 6916b80
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/de/zbit/kegg/gui/TranslatorUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@ protected JToolBar createJToolBar() {
final JToolBar r = new JToolBar("Translate new file",
JToolBar.HORIZONTAL);

r.add(PreferencesPanel.getJComponentForOption(KEGGtranslatorIOOptions.INPUT,
prefsIO, this));
JComponent jc = PreferencesPanel.getJComponentForOption(KEGGtranslatorIOOptions.INPUT, prefsIO, this);
// Allow a change of Focus (important!)
if (jc instanceof FileSelector) ((FileSelector)jc).removeInputVerifier();
r.add(jc);

// r.add(new JSeparator(JSeparator.VERTICAL));
r.add(PreferencesPanel.getJComponentForOption(KEGGtranslatorIOOptions.FORMAT,
prefsIO, this));
Expand Down Expand Up @@ -618,8 +621,9 @@ public void exit() {
Translator.saveCache();

SBProperties props = new SBProperties();
if (getInputFile(toolBar) != null) {
props.put(KEGGtranslatorIOOptions.INPUT, getInputFile(toolBar));
File f = getInputFile(toolBar);
if (f != null && KEGGtranslatorIOOptions.INPUT.getRange().isInRange(f)) {
props.put(KEGGtranslatorIOOptions.INPUT, f);
}
props.put(KEGGtranslatorIOOptions.FORMAT, getOutputFileFormat(toolBar));
SBPreferences.saveProperties(KEGGtranslatorIOOptions.class, props);
Expand Down

0 comments on commit 6916b80

Please sign in to comment.