JAL-3691 automatic insertion of Locale.ROOT to toUpperCase() and toLowerCase() and...
[jalview.git] / src / jalview / gui / Help.java
index 83fcaf7..8bd01ea 100644 (file)
@@ -92,44 +92,53 @@ public class Help
    */
   public static void showHelpWindow(HelpId id) throws HelpSetException
   {
-       if (Platform.isJS())
-       {
-         try 
-         {
-               BrowserLauncher.openURL(HELP_PAGE_ROOT + id.getPath());
-         } catch (IOException e) {}
-           return;
-       }
-       
-    ClassLoader cl = Desktop.class.getClassLoader();
-    URL url = HelpSet.findHelpSet(cl, "help/help"); // $NON-NLS-$
-    HelpSet hs = new HelpSet(cl, url);
-
-    if (hb == null)
+    if (Platform.isJS())
     {
-      /*
-       * create help broker first time (only)
-       */
-      hb = hs.createHelpBroker();
+      try
+      {
+        BrowserLauncher.openURL(HELP_PAGE_ROOT + id.getPath());
+      } catch (IOException e)
+      {
+      }
     }
-
-    try
-    {
-      hb.setCurrentID(id.getId());
-    } catch (BadIDException bad)
+    else
+    /**
+     * Java only
+     * 
+     * @j2sIgnore
+     */
     {
-      System.out.println("Bad help link: " + id.getId()
-              + ": must match a target in help.jhm");
-      throw bad;
-    }
 
-    /*
-     * set Help visible - at its current location if it is already shown,
-     * else at a location as determined by the window manager
-     */
-    Point p = hb.getLocation();
-    hb.setLocation(p);
-    hb.setDisplayed(true);
+      ClassLoader cl = Desktop.class.getClassLoader();
+      URL url = HelpSet.findHelpSet(cl, "help/help"); // $NON-NLS-$
+      HelpSet hs = new HelpSet(cl, url);
+
+      if (hb == null)
+      {
+        /*
+         * create help broker first time (only)
+         */
+        hb = hs.createHelpBroker();
+      }
+
+      try
+      {
+        hb.setCurrentID(id.getId());
+      } catch (BadIDException bad)
+      {
+        System.out.println("Bad help link: " + id.getId()
+                + ": must match a target in help.jhm");
+        throw bad;
+      }
+
+      /*
+       * set Help visible - at its current location if it is already shown,
+       * else at a location as determined by the window manager
+       */
+      Point p = hb.getLocation();
+      hb.setLocation(p);
+      hb.setDisplayed(true);
+    }
   }
 
   /**