axis.jar
biojava-core-4.1.0.jar LGPLv2.1 - latest license at https://github.com/biojava/biojava/blob/master/LICENSE
biojava-ontology-4.1.0.jar LGPLv2.1 - latest license at https://github.com/biojava/biojava/blob/master/LICENSE
-BrowserLauncher2-1_3.jar LGPLv2.1
commons-codec-1.3.jar
commons-logging-1.1.1.jar
getdown-core.jar Getdown license - https://github.com/threerings/getdown/blob/master/LICENSE
+++ /dev/null
-# ************************************************
-# Copyright 2006,2007 Jeff Chapman
-#
-# This file is part of BrowserLauncher2.
-#
-# BrowserLauncher2 is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# BrowserLauncher2 is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with BrowserLauncher2; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# ************************************************
-# $Id: linuxUnixConfig.properties,v 1.3 2007/06/13 19:25:54 jchapman0 Exp $
-
-# delimiter for browser listing
-delimchar=;
-
-# list of browsers and arguments for using them
-# display name | executable name | start browser args | invoke already started browser | force new window
-browser.mozilla=Mozilla;mozilla;<browser> <url>;<browser> -remote openURL(<url>)
-browser.netscape=Netscape;netscape;<browser> <url>;<browser> -remote openURL(<url>)
-browser.firefox=Firefox;firefox;<browser> <url>;<browser> -new-tab <url>;<browser> -new-window <url>
-browser.mozilla-firefox=Firefox;mozilla-firefox;<browser> <url>;<browser> -remote openURL(<url>);<browser> -new-window <url>
-browser.konqueror=Konqueror;kfmclient;<browser> openURL <url>;<browser> newTab <url>;<browser> openURL <url>
-browser.opera=Opera;opera;<browser> <url>;<browser> -newpage <url>;<browser> -newwindow <url>
-browser.epiphany=Epiphany;epiphany;<browser> <url>;<browser> --new-tab <url>
-browser.chrome=Google Chrome;google-chrome;<browser> <url>;<browser> <url>;<browser> --new-window <url>
-browser.chrome-stable=Google Chrome;google-chrome-stable;<browser> <url>;<browser> <url>;<browser> --new-window <url>
+++ /dev/null
-# ************************************************
-# Copyright 2006 Jeff Chapman
-#
-# This file is part of BrowserLauncher2.
-#
-# BrowserLauncher2 is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# BrowserLauncher2 is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with BrowserLauncher2; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# ************************************************
-# $Id: sunOSConfig.properties,v 1.2 2006/09/12 15:40:34 jchapman0 Exp $
-
-# delimiter for browser listing
-delimchar=;
-
-# list of browsers and arguments for using them
-# display name | executable name | start browser args | invoke already started browser
-browser.sdtwebclient=Default;sdtwebclient;<browser> <url>;<browser> -remote openURL(<url>)
-browser.mozilla=Mozilla;mozilla;<browser> <url>;<browser> -remote openURL(<url>)
-browser.netscape=Netscape;netscape;<browser> <url>;<browser> -remote openURL(<url>)
-browser.firefox=FireFox;firefox;<browser> <url>;<browser> -remote openURL(<url>);<browser> -new-window <url>
-browser.opera=Opera;opera;<browser> <url>;<browser> -newpage <url>;<browser> -newwindow <url>
-
+++ /dev/null
-# ************************************************
-# Copyright 2006,2007 Jeff Chapman
-#
-# This file is part of BrowserLauncher2.
-#
-# BrowserLauncher2 is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# BrowserLauncher2 is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with BrowserLauncher2; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# ************************************************
-# $Id: windowsConfig.properties,v 1.6 2007/08/30 19:38:09 jchapman0 Exp $
-
-# delimiter for browser listing
-delimchar=;
-
-# windows versions and arguments for launching a browser
-# default (will be used for Win10 and Win11) is winNT
-# command for starting default browser | command for starting a specific browser | use registry
-windows.winVista=cmd.exe /c start "" "<url>";"<path><browser>.exe" <args> "<url>";true
-windows.win2000=cmd.exe /c start "" "<url>";"<path><browser>.exe" <args> "<url>";true
-windows.win9x=command.com /c start "<url>";"<path><browser>.exe" <args> "<url>";true
-windows.winNT=cmd.exe /c start "" "<url>";"<path><browser>.exe" <args> "<url>";true
-
-# properties used to find browsers in program files folder
-program.files.template={0}:\\Program Files
-# drive letters to try when looking for Program Files folder
-drive.letters=C;D;E
-
-#windows.win2000=cmd.exe /c start "" "<url>";cmd.exe /c start <browser> <args> "<url>"
-#windows.win9x=command.com /c start "<url>";command.com /c start <browser> <args> "<url>"
-#windows.winNT=cmd.exe /c start "" "<url>";cmd.exe /c start <browser> <args> "<url>"
-
-# list of browsers and arguments for using them and discovering them
-# browser display name | browser exe name | new window argument | directory containing exe
-browser.mozilla=Mozilla;mozilla;;mozilla.org
-browser.netscape=Netscape;netscape;;Netscape
-browser.mozilla-firefox=Mozilla Firefox;firefox;-new-window;Mozilla Firefox
-browser.firefox=Firefox;firefox;-new-window;Firefox
-browser.opera=Opera;opera;-newwindow;Opera
-browser.edge=Microsoft Edge;msedge;;Microsoft
-browser.kmeleon=K-Meleon;k-meleon;;K-Meleon
-browser.chrome=Google Chrome;chrome;;Google
exception.browser_not_found = Exception in finding browser: {0}
exception.browser_unable_to_launch = Unable to launch browser: {0}
exception.browser_unable_to_locate = Unable to locate browser: {0}
-exception.browser_os_not_supported = Launching browser on this operating system not supported: {0}. Use URL\n{1}
+exception.browser_os_not_supported = Launching browser on this operating system not supported. Use URL\n{0}
exception.invocation_target_exception_creating_aedesc = InvocationTargetException while creating AEDesc: {0}
exception.illegal_access_building_apple_evt= IllegalAccessException while building AppleEvent: {0}
exception.unable_to_launch_url = Unable to launch URL: {0}
exception.browser_not_found = Excepción al buscar el navegador: {0}
exception.browser_unable_to_launch = Imposible iniciar el navegador: {0}
exception.browser_unable_to_locate = Imposible encontrar el navegador: {0}
-exception.browser_os_not_supported = No se admite el inicio del navegador en este sistema operativo: {0}. Usar URL\n{1}
+exception.browser_os_not_supported = No se admite el inicio del navegador en este sistema operativo. Usar URL\n{0}
exception.invocation_target_exception_creating_aedesc = InvocationTargetException mientras se creaba AEDesc: {0}
exception.illegal_access_building_apple_evt= IllegalAccessException mientras se construía AppleEvent: {0}
exception.unable_to_launch_url = Imposible lanzar la URL: {0}
import com.threerings.getdown.util.LaunchUtil;
-import edu.stanford.ejalbert.launching.IBrowserLaunching;
+//import edu.stanford.ejalbert.launching.IBrowserLaunching;
import groovy.lang.Binding;
import groovy.util.GroovyScriptEngine;
import jalview.ext.so.SequenceOntology;
String defaultBrowser = Cache.getProperty("DEFAULT_BROWSER");
if (defaultBrowser != null)
{
- System.setProperty(IBrowserLaunching.BROWSER_SYSTEM_PROPERTY,
+ System.setProperty(BrowserLauncher.getBrowserSystemProperty(),
defaultBrowser);
BrowserLauncher.resetBrowser();
} // don't clearProperty if DEFAULT_BROWSER is null, might be set by user
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
-import edu.stanford.ejalbert.launching.IBrowserLaunching;
+//import edu.stanford.ejalbert.launching.IBrowserLaunching;
import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.bin.Cache;
Cache.setOrRemove("DEFAULT_BROWSER",
(String) defaultBrowser.getSelectedItem());
- if (Cache.getProperty("DEFAULT_BROWSER") != null)
- {
- System.setProperty(IBrowserLaunching.BROWSER_SYSTEM_PROPERTY,
- Cache.getProperty("DEFAULT_BROWSER"));
- }
- else
- {
- System.clearProperty(IBrowserLaunching.BROWSER_SYSTEM_PROPERTY);
- }
- BrowserLauncher.resetBrowser();
+ BrowserLauncher.resetBrowser(true);
// save user-defined and selected links
String menuLinks = sequenceUrlLinks.writeUrlsAsString(true);
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
-import javax.swing.ComboBoxModel;
-import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import jalview.io.BackupFiles;
import jalview.io.BackupFilesPresetEntry;
import jalview.io.IntKeyStringValueEntry;
-import jalview.util.BrowserLauncher;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.util.StringUtils;
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<String> cbModel = new DefaultComboBoxModel(
BrowserLauncher.getInstance().getBrowserList().toArray());
String browserPref = Cache.getProperty("DEFAULT_BROWSER");
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,
package jalview.util;
-import edu.stanford.ejalbert.exception.BrowserLaunchingInitializingException;
-import edu.stanford.ejalbert.exception.UnsupportedOperatingSystemException;
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
import jalview.bin.Cache;
import jalview.bin.Console;
-public class BrowserLauncher extends edu.stanford.ejalbert.BrowserLauncher
+public class BrowserLauncher
{
private static BrowserLauncher INSTANCE = null;
- // get singleton BrowserLauncher instance
+ private static String preferredBrowser = null;
+
public static BrowserLauncher getInstance()
{
- if (INSTANCE == null)
+ if (INSTANCE != null)
{
- try
- {
- INSTANCE = new BrowserLauncher();
- } catch (BrowserLaunchingInitializingException e)
- {
- Console.warn(MessageManager.formatMessage(
- "exception.browser_unable_to_launch", e.getMessage()));
- } catch (UnsupportedOperatingSystemException e)
- {
- Console.warn(MessageManager.formatMessage("exception."));
- Console.debug(e.getMessage());
- }
+ return INSTANCE;
}
+ INSTANCE = new BrowserLauncher();
return INSTANCE;
}
- public BrowserLauncher() throws BrowserLaunchingInitializingException,
- UnsupportedOperatingSystemException
- {
- super();
- }
-
- private static String preferredBrowser = null;
-
public static void openURL(String url)
{
if (Platform.isJS())
* @j2sIgnore
*/
{
- BrowserLauncher bl = getInstance();
- if (bl != null)
+ Desktop d = Desktop.getDesktop();
+ if (d != null && d.isSupported(Desktop.Action.BROWSE))
{
- if (Platform.isMac() || preferredBrowser == null)
+ try
{
- bl.openURLinBrowser(url);
- }
- else
+ d.browse(new URI(url));
+ } catch (IOException e)
+ {
+ Console.warn(MessageManager.formatMessage(
+ "exception.browser_unable_to_launch", url));
+ Console.warn(e.getMessage());
+ Console.debug(Cache.getStackTraceString(e));
+ } catch (URISyntaxException e1)
{
- bl.openURLinBrowser(preferredBrowser, url);
+ Console.warn(MessageManager.formatMessage(
+ "exception.browser_unable_to_launch", url));
+ Console.warn(e1.getMessage());
+ Console.debug(Cache.getStackTraceString(e1));
}
}
else
{
- Console.warn("Could not open URL '" + url + "'");
+ Console.warn(MessageManager
+ .formatMessage("exception.browser_os_not_supported", url));
}
}
}
public static void resetBrowser()
{
+ resetBrowser(false);
+ }
+
+ public static void resetBrowser(boolean removeIfNull)
+ {
String defaultBrowser = Cache.getProperty("DEFAULT_BROWSER");
preferredBrowser = defaultBrowser;
+ // System.setProperty(getBrowserSystemProperty(),
+ // Cache.getProperty("DEFAULT_BROWSER"));
+ if (defaultBrowser == null && removeIfNull)
+ {
+ // System.clearProperty(getBrowserSystemProperty());
+ }
+
}
+
+ public static List<String> getBrowserList()
+ {
+ return new ArrayList<String>();
+ }
+
+ public static String getBrowserSystemProperty()
+ {
+ // return IBrowserLaunching.BROWSER_SYSTEM_PROPERTY;
+ return "jalview.default.browser";
+ }
+
}
\ No newline at end of file