X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FHelp.java;h=8bd01ea42916fa907c0249ae3426b932663588be;hb=afffa24481a7d3cb65ae41e0948c16a5f490f302;hp=83fcaf708ebd1944e9718d1f18ca0a3929451748;hpb=ae81fc691048b2151003030cb079bee26a0b610c;p=jalview.git diff --git a/src/jalview/gui/Help.java b/src/jalview/gui/Help.java index 83fcaf7..8bd01ea 100644 --- a/src/jalview/gui/Help.java +++ b/src/jalview/gui/Help.java @@ -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); + } } /**