JAL-3949 Complete new abstracted logging framework in jalview.log. Updated log calls...
[jalview.git] / src / jalview / util / BrowserLauncher.java
index 0bc09cc..dbd9177 100755 (executable)
@@ -20,6 +20,8 @@
  */
 package jalview.util;
 
+import jalview.bin.Cache;
+
 import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.Constructor;
@@ -233,8 +235,17 @@ public class BrowserLauncher
    */
   static
   {
+
     loadedWithoutErrors = true;
 
+    if (!Platform.isJS())
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
+     * 
+     */
+    {
     String osName = System.getProperty("os.name");
 
     if (osName.startsWith("Mac OS"))
@@ -307,6 +318,7 @@ public class BrowserLauncher
     { // if we haven't hit any errors yet
       loadedWithoutErrors = loadClasses();
     }
+    }
   }
 
   /**
@@ -325,6 +337,15 @@ public class BrowserLauncher
    */
   private static boolean loadClasses()
   {
+
+    if (!Platform.isJS())
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
+     * 
+     */
+    {
     switch (jvm)
     {
     case MRJ_2_0:
@@ -507,6 +528,7 @@ public class BrowserLauncher
       break;
     }
 
+    }
     return true;
   }
 
@@ -523,6 +545,14 @@ public class BrowserLauncher
    */
   private static Object locateBrowser()
   {
+    if (!Platform.isJS())
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
+     * 
+     */
+    {
     if (browser != null)
     {
       return browser;
@@ -684,12 +714,15 @@ public class BrowserLauncher
 
     case OTHER:
     default:
-      browser = jalview.bin.Cache.getDefault("DEFAULT_BROWSER", "firefox");
+      browser = Cache.getDefault("DEFAULT_BROWSER", "firefox");
 
       break;
     }
 
+    }
+
     return browser;
+
   }
 
   /**
@@ -711,6 +744,20 @@ public class BrowserLauncher
    */
   public static void openURL(String url) throws IOException
   {
+
+    if (Platform.isJS())
+    {
+      Platform.openURL(url);
+      return;
+    }
+    else
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
+     */
+    {
+
     if (!loadedWithoutErrors)
     {
       throw new IOException(MessageManager
@@ -896,8 +943,10 @@ public class BrowserLauncher
 
       break;
     }
+    }
   }
 
+
   /**
    * Methods required for Mac OS X. The presence of native methods does not
    * cause any problems on other platforms.