made error for browser configuration on unix a bit easier to see.
[jalview.git] / src / jalview / util / BrowserLauncher.java
index b169dc4..a36ea27 100755 (executable)
@@ -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.
  * <p>
- * 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 <init>(int) method of com.apple.MacOS.AETarget */
+        /** The &lt;init&gt;(int) method of com.apple.MacOS.AETarget */
         private static Constructor aeTargetConstructor;
 
-        /** The <init>(int, int, int) method of com.apple.MacOS.AppleEvent */
+        /** The &lt;init&gt;(int, int, int) method of com.apple.MacOS.AppleEvent */
         private static Constructor appleEventConstructor;
 
-        /** The <init>(String) method of com.apple.MacOS.AEDesc */
+        /** The &lt;init&gt;(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();