From 8193add590cf13e5bdb422347473f1d96755c4f3 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 28 Jun 2018 16:52:56 +0100 Subject: [PATCH] JAL-3048 TODOs for refactoring JalviewFileChooser pattern JAL-3026 disable browser select dialog for default browser in javasript --- src/jalview/gui/Preferences.java | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index 7d02fac..019b29e 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -833,6 +833,7 @@ public class Preferences extends GPreferences @Override public void startupFileTextfield_mouseClicked() { + // TODO: JAL-3048 not needed for Jalview-JS String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT"); JalviewFileChooser chooser = JalviewFileChooser .forRead(Cache.getProperty("LAST_DIRECTORY"), fileFormat); @@ -1006,17 +1007,22 @@ public class Preferences extends GPreferences @Override public void defaultBrowser_mouseClicked(MouseEvent e) { - JFileChooser chooser = new JFileChooser("."); - chooser.setDialogTitle( - MessageManager.getString("label.select_default_browser")); + // TODO: JAL-3048 not needed for j2s + /* + * @j2sNative + */ + { + JFileChooser chooser = new JFileChooser("."); + chooser.setDialogTitle( + MessageManager.getString("label.select_default_browser")); - int value = chooser.showOpenDialog(this); + int value = chooser.showOpenDialog(this); - if (value == JFileChooser.APPROVE_OPTION) - { - defaultBrowser.setText(chooser.getSelectedFile().getAbsolutePath()); + if (value == JFileChooser.APPROVE_OPTION) + { + defaultBrowser.setText(chooser.getSelectedFile().getAbsolutePath()); + } } - } /* -- 1.7.10.2