From: Ben Soares Date: Tue, 8 Mar 2022 12:14:45 +0000 (+0000) Subject: JAL-3103 Removed code and unused widgets for defaultBrowser X-Git-Tag: Release_2_11_2_1~25^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5837c2892545c25ef5a8bc75248a997b96cc8e4e;p=jalview.git JAL-3103 Removed code and unused widgets for defaultBrowser --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 4fc7714..fc4c821 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -70,7 +70,6 @@ import jalview.io.NewickFile; import jalview.io.gff.SequenceOntologyFactory; import jalview.schemes.ColourSchemeI; import jalview.schemes.ColourSchemeProperty; -import jalview.util.BrowserLauncher; import jalview.util.ChannelProperties; import jalview.util.HttpUtils; import jalview.util.MessageManager; @@ -510,15 +509,6 @@ public class Jalview }.start(); } - // set default browser - String defaultBrowser = Cache.getProperty("DEFAULT_BROWSER"); - if (defaultBrowser != null) - { - System.setProperty(BrowserLauncher.getBrowserSystemProperty(), - defaultBrowser); - BrowserLauncher.resetBrowser(); - } // don't clearProperty if DEFAULT_BROWSER is null, might be set by user - String file = null, data = null; FileFormatI format = null; DataSourceType protocol = null; diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index fe0aea1..06d3a60 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -27,7 +27,6 @@ import java.awt.Dimension; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; import java.io.File; import java.util.ArrayList; import java.util.List; @@ -35,7 +34,6 @@ import java.util.concurrent.CompletableFuture; import javax.help.HelpSetException; import javax.swing.JComboBox; -import javax.swing.JFileChooser; import javax.swing.JInternalFrame; import javax.swing.JPanel; import javax.swing.ListSelectionModel; @@ -74,7 +72,6 @@ import jalview.urls.UrlLinkTableModel; import jalview.urls.api.UrlProviderFactoryI; import jalview.urls.api.UrlProviderI; import jalview.urls.desktop.DesktopUrlProviderFactory; -import jalview.util.BrowserLauncher; import jalview.util.MessageManager; import jalview.util.Platform; import jalview.util.UrlConstants; @@ -641,12 +638,6 @@ public class Preferences extends GPreferences setCustomProxyEnabled(); applyProxyButtonEnabled(false); - String browserPref = Cache.getDefault("DEFAULT_BROWSER", ""); - if (browserPref != null) - { - defaultBrowser.getModel().setSelectedItem(browserPref); - } - usagestats.setSelected(Cache.getDefault("USAGESTATS", false)); // note antisense here: default is true questionnaire @@ -893,10 +884,6 @@ public class Preferences extends GPreferences */ // Proxy settings set first (to catch web services) - Cache.setOrRemove("DEFAULT_BROWSER", - (String) defaultBrowser.getSelectedItem()); - BrowserLauncher.resetBrowser(true); - // save user-defined and selected links String menuLinks = sequenceUrlLinks.writeUrlsAsString(true); if (menuLinks.isEmpty()) @@ -1261,31 +1248,6 @@ public class Preferences extends GPreferences ((UrlLinkTableModel) linkUrlTable.getModel()).removeRow(modelIndex); } - @Override - public void defaultBrowser_mouseClicked(MouseEvent e) - { - // TODO: JAL-3048 not needed for j2s - if (!Platform.isJS()) // BH 2019 - /** - * Java only - * - * @j2sIgnore - */ - { - JFileChooser chooser = new JFileChooser("."); - chooser.setDialogTitle( - MessageManager.getString("label.select_default_browser")); - - int value = chooser.showOpenDialog(this); - - if (value == JFileChooser.APPROVE_OPTION) - { - defaultBrowser.getModel().setSelectedItem( - chooser.getSelectedFile().getAbsolutePath()); - } - } - } - /* * (non-Javadoc) * diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index 0d2b623..69c0f4d 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -269,8 +269,6 @@ public class GPreferences extends JPanel protected JPasswordField proxyAuthPasswordPB = new JPasswordField(); - protected JComboBox defaultBrowser = new JComboBox(); - protected ButtonGroup proxyType = new ButtonGroup(); protected JRadioButton noProxy = new JRadioButton(); @@ -740,55 +738,9 @@ public class GPreferences extends JPanel connectTab = new JPanel(); connectTab.setLayout(new GridBagLayout()); - // Label for browser text box - JLabel browserLabel = new JLabel(); - browserLabel.setFont(LABEL_FONT); - browserLabel.setHorizontalAlignment(SwingConstants.TRAILING); - browserLabel.setText( - MessageManager.getString("label.default_browser_unix_windows")); - defaultBrowser.setFont(LABEL_FONT); - final String tooltip = JvSwingUtils.wrapTooltip(true, - MessageManager.getString("label.double_click_to_browse")); - defaultBrowser.setToolTipText(tooltip); - /* - defaultBrowser.addMouseListener(new MouseAdapter() - { - @Override - public void mouseClicked(MouseEvent e) - { - if (e.getClickCount() > 1) - { - defaultBrowser_mouseClicked(e); - } - } - }); - */ - JPanel proxyPanel = initConnTabProxyPanel(); initConnTabCheckboxes(); - /* removing default browser preference and using Desktop.browse() - // Add default Browser text box - connectTab.add(browserLabel, - new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, - GridBagConstraints.WEST, GridBagConstraints.NONE, - new Insets(10, 0, 5, 5), 5, 1)); - defaultBrowser.setFont(LABEL_FONT); - - ComboBoxModel cbModel = new DefaultComboBoxModel( - BrowserLauncher.getInstance().getBrowserList().toArray()); - String browserPref = Cache.getProperty("DEFAULT_BROWSER"); - if (browserPref != null) - { - cbModel.setSelectedItem(browserPref); - } - defaultBrowser.setModel(cbModel); - - connectTab.add(defaultBrowser, new GridBagConstraints(1, 0, 1, 1, 1.0, - 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, - new Insets(10, 0, 5, 10), 30, 1)); - */ - // Add proxy server panel connectTab.add(proxyPanel, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, @@ -3546,11 +3498,6 @@ public class GPreferences extends JPanel } - public void defaultBrowser_mouseClicked(MouseEvent e) - { - - } - public void linkURLList_keyTyped(KeyEvent e) {