- /*
- * 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);
+ }