From: hansonr Date: Sat, 23 Jun 2018 23:00:07 +0000 (+0100) Subject: JAL-3032 BrowserLauncher simplified for JS X-Git-Tag: Release_2_11_4_0~45^2~18^2~658 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=69241a5225dc2abcca0b1ccdd2a17769d5b0f5bb;p=jalview.git JAL-3032 BrowserLauncher simplified for JS window.open(url) --- diff --git a/src/jalview/util/BrowserLauncher.java b/src/jalview/util/BrowserLauncher.java index 0bc09cc..a55a65c 100755 --- a/src/jalview/util/BrowserLauncher.java +++ b/src/jalview/util/BrowserLauncher.java @@ -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.