home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Help / runWin32JavaHelp.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  1.6 KB  |  56 lines

  1. !!Script
  2. // Copyright ⌐ 1997-2000 - Modelworks Software
  3.  
  4. /**
  5. @Tool: runWin32JavaHelp~lets you get help from Windows Java help files. 
  6. To use it select a keyword in a Java document and then hit F1, the tool bar 
  7. help button or run this script. This script will also be invoked for document 
  8. types based on the Java type. If you want to access 
  9. Java help from another document type then assign this script a hot key. 
  10. @Paragraph: Use the javaHelp script in Tools/Configuration to set the location 
  11. of your Java help file. 
  12. @EndTool: 
  13. @Summary: runWin32JavaHelp~lets you get help from Windows Java help files
  14. */
  15.  
  16. var gOutput = getOutput();
  17.  
  18. function DoCommand()
  19. {
  20.    Win32Help();    
  21. }
  22.  
  23. function Win32Help()
  24. {
  25.     var helpers = getMapFile("ApplicationHelpers");   
  26.     if (helpers)
  27.     {
  28.         var javaHelp = helpers.lookup("java-help");
  29.         if (javaHelp && javaHelp.exists)
  30.         {
  31.             var editor = getActiveEditor();
  32.             if (editor)
  33.             {
  34.                 var selection = editor.getSelection();
  35.                 var keyword = editor.copy(selection);
  36.                 winHelp("Keyword", javaHelp.path, keyword);
  37.             }
  38.             else
  39.             {
  40.                 winHelp("Contents", javaHelp.path);
  41.             }
  42.         }
  43.         else
  44.         {
  45.             var result = confirm("You need to run the Java help setup script\n"
  46.             + "before you can use this command.\n" +
  47.             "Do you want to run the setup script now?");
  48.             if (result)
  49.             {
  50.                 run("Configuration\\JavaHelp");
  51.             }
  52.         }
  53.     }
  54. }
  55. !!/Script
  56.