X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FBrowserLauncher.java;h=a36ea275735443cbf1a8b59e2d726997b115502e;hb=82e0c09533b4f568b50fdc290be58589cea3ebb6;hp=b169dc4439fa194fea664bc61e39f262f7589679;hpb=1ecf6419aba86993b3c223bf5ec0fa79427baf85;p=jalview.git diff --git a/src/jalview/util/BrowserLauncher.java b/src/jalview/util/BrowserLauncher.java index b169dc4..a36ea27 100755 --- a/src/jalview/util/BrowserLauncher.java +++ b/src/jalview/util/BrowserLauncher.java @@ -43,7 +43,7 @@ import java.lang.reflect.Method; * back from the inherently platform-sensitive concept of a default browser and simply attempts * to launch Netscape via a shell command. *

- * This code is Copyright 1999-2001 by Eric Albert (ejalbert@cs.stanford.edu) and may be + * This code is Copyright 1999-2001 by Eric Albert (ejalbert\@cs.stanford.edu) and may be * redistributed or modified in any form without restrictions as long as the portion of this * comment from this paragraph through the end of the comment is not removed. The author * requests that he be notified of any application, applet, or other binary that makes use of @@ -87,13 +87,13 @@ public class BrowserLauncher { /** The com.apple.MacOS.AEDesc class */ private static Class aeDescClass; - /** The (int) method of com.apple.MacOS.AETarget */ + /** The <init>(int) method of com.apple.MacOS.AETarget */ private static Constructor aeTargetConstructor; - /** The (int, int, int) method of com.apple.MacOS.AppleEvent */ + /** The <init>(int, int, int) method of com.apple.MacOS.AppleEvent */ private static Constructor appleEventConstructor; - /** The (String) method of com.apple.MacOS.AEDesc */ + /** The <init>(String) method of com.apple.MacOS.AEDesc */ private static Constructor aeDescConstructor; /** The findFolder method of com.apple.mrj.MRJFileUtils */ @@ -193,6 +193,7 @@ public class BrowserLauncher { */ private static final String NETSCAPE_REMOTE_PARAMETER = "-remote"; private static final String NETSCAPE_OPEN_PARAMETER_START = "openURL("; + private static final String NETSCAPE_OPEN_NEW_WINDOW = ", new-window"; private static final String NETSCAPE_OPEN_PARAMETER_END = ")"; /** @@ -466,7 +467,11 @@ public class BrowserLauncher { break; case OTHER: default: - browser = "netscape"; + browser = jalview.bin.Cache.applicationProperties.getProperty("jalview.browser"); + if (browser==null) { + // hope firefox exists :-/ + browser = "firefox"; + } break; } return browser; @@ -556,13 +561,14 @@ public class BrowserLauncher { } break; case OTHER: - // Assume that we're on Unix and that Netscape is installed + // Assume that we're on Unix and that Netscape (actually Firefox) is installed // First, attempt to open the URL in a currently running session of Netscape process = Runtime.getRuntime().exec(new String[] { (String) browser, NETSCAPE_REMOTE_PARAMETER, NETSCAPE_OPEN_PARAMETER_START + url + + NETSCAPE_OPEN_NEW_WINDOW + NETSCAPE_OPEN_PARAMETER_END }); try { int exitCode = process.waitFor();