5 import javax.help.HelpBroker;
6 import javax.help.HelpSet;
7 import javax.help.HelpSetException;
10 * Utility class to show the help documentation window.
18 private static final long HALF_A_MO = 500; // half a second
20 private static long lastOpenedTime = 0L;
31 * Show help text in a new window. But do nothing if within half a second of
32 * the last invocation.
34 * This is a workaround for issue JAL-914 - both Desktop and AlignFrame
35 * responding to F1 key, resulting in duplicate help windows opened.
37 * @throws HelpSetException
39 public static void showHelpWindow() throws HelpSetException
41 long timeNow = System.currentTimeMillis();
43 if (timeNow - lastOpenedTime > HALF_A_MO)
45 lastOpenedTime = timeNow;
46 ClassLoader cl = Desktop.class.getClassLoader();
47 URL url = HelpSet.findHelpSet(cl, "help/help"); // $NON-NLS-$
48 HelpSet hs = new HelpSet(cl, url);
50 HelpBroker hb = hs.createHelpBroker();
51 hb.setCurrentID("home");
52 hb.setDisplayed(true);