home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 1997-2000 - Modelworks Software
-
- /**
- @Tool: runWin32JavaHelp~lets you get help from Windows Java help files.
- To use it select a keyword in a Java document and then hit F1, the tool bar
- help button or run this script. This script will also be invoked for document
- types based on the Java type. If you want to access
- Java help from another document type then assign this script a hot key.
- @Paragraph: Use the javaHelp script in Tools/Configuration to set the location
- of your Java help file.
- @EndTool:
- @Summary: runWin32JavaHelp~lets you get help from Windows Java help files
- */
-
- var gOutput = getOutput();
-
- function DoCommand()
- {
- Win32Help();
- }
-
- function Win32Help()
- {
- var helpers = getMapFile("ApplicationHelpers");
- if (helpers)
- {
- var javaHelp = helpers.lookup("java-help");
- if (javaHelp && javaHelp.exists)
- {
- var editor = getActiveEditor();
- if (editor)
- {
- var selection = editor.getSelection();
- var keyword = editor.copy(selection);
- winHelp("Keyword", javaHelp.path, keyword);
- }
- else
- {
- winHelp("Contents", javaHelp.path);
- }
- }
- else
- {
- var result = confirm("You need to run the Java help setup script\n"
- + "before you can use this command.\n" +
- "Do you want to run the setup script now?");
- if (result)
- {
- run("Configuration\\JavaHelp");
- }
- }
- }
- }
- !!/Script
-