JAL-3032 BrowserLauncher simplified for JS
[jalview.git] / src / jalview / util / BrowserLauncher.java
index 0bc09cc..a55a65c 100755 (executable)
@@ -233,8 +233,15 @@ public class BrowserLauncher
    */
   static
   {
+
     loadedWithoutErrors = true;
 
+    /**
+     * 
+     * @j2sNative
+     * 
+     */
+    {
     String osName = System.getProperty("os.name");
 
     if (osName.startsWith("Mac OS"))
@@ -307,6 +314,7 @@ public class BrowserLauncher
     { // if we haven't hit any errors yet
       loadedWithoutErrors = loadClasses();
     }
+    }
   }
 
   /**
@@ -325,6 +333,12 @@ public class BrowserLauncher
    */
   private static boolean loadClasses()
   {
+
+    /**
+     * @j2sNative
+     * 
+     */
+    {
     switch (jvm)
     {
     case MRJ_2_0:
@@ -507,6 +521,7 @@ public class BrowserLauncher
       break;
     }
 
+    }
     return true;
   }
 
@@ -523,6 +538,11 @@ public class BrowserLauncher
    */
   private static Object locateBrowser()
   {
+    /**
+     * @j2sNative
+     * 
+     */
+    {
     if (browser != null)
     {
       return browser;
@@ -689,7 +709,10 @@ public class BrowserLauncher
       break;
     }
 
+    }
+
     return browser;
+
   }
 
   /**
@@ -711,6 +734,17 @@ public class BrowserLauncher
    */
   public static void openURL(String url) throws IOException
   {
+
+    /**
+     * @j2sNative
+     * 
+     *            window.open(url);
+     * 
+     * 
+     */
+
+    {
+
     if (!loadedWithoutErrors)
     {
       throw new IOException(MessageManager
@@ -896,8 +930,10 @@ public class BrowserLauncher
 
       break;
     }
+    }
   }
 
+
   /**
    * Methods required for Mac OS X. The presence of native methods does not
    * cause any problems on other platforms.