X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FBrowserLauncher.java;h=8119daa8edbefac5d9b24f6437d378ef00d7e06a;hb=a69ff693f6d3bc0969874e12812316a9c0bbc6fd;hp=87e57fd7e78b2b433186b0b0820f825fda2d4770;hpb=c1e22e204c48fe7fc30dbb95be46e5a04808898a;p=jalview.git diff --git a/src/jalview/util/BrowserLauncher.java b/src/jalview/util/BrowserLauncher.java index 87e57fd..8119daa 100755 --- a/src/jalview/util/BrowserLauncher.java +++ b/src/jalview/util/BrowserLauncher.java @@ -233,8 +233,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 +316,7 @@ public class BrowserLauncher { // if we haven't hit any errors yet loadedWithoutErrors = loadClasses(); } + } } /** @@ -325,6 +335,15 @@ public class BrowserLauncher */ private static boolean loadClasses() { + + if (!Platform.isJS()) + /** + * Java only + * + * @j2sIgnore + * + */ + { switch (jvm) { case MRJ_2_0: @@ -507,6 +526,7 @@ public class BrowserLauncher break; } + } return true; } @@ -523,10 +543,14 @@ public class BrowserLauncher */ private static Object locateBrowser() { - if (true) + if (!Platform.isJS()) + /** + * Java only + * + * @j2sIgnore + * + */ { - return "/Volumes/Macintosh HD/Applications/Firefox.app/Contents/MacOS/firefox"; - } if (browser != null) { return browser; @@ -693,7 +717,10 @@ public class BrowserLauncher break; } + } + return browser; + } /** @@ -715,7 +742,21 @@ public class BrowserLauncher */ public static void openURL(String url) throws IOException { - if (false && !loadedWithoutErrors) + + if (Platform.isJS()) + { + Platform.openURL(url); + return; + } + else + /** + * Java only + * + * @j2sIgnore + */ + { + + if (!loadedWithoutErrors) { throw new IOException(MessageManager .formatMessage("exception.browser_not_found", new String[] @@ -900,8 +941,10 @@ public class BrowserLauncher break; } + } } + /** * Methods required for Mac OS X. The presence of native methods does not * cause any problems on other platforms.