home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / EDITJDKOPTIONS.SCRIPT < prev    next >
Encoding:
Text File  |  2002-07-23  |  8.2 KB  |  231 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3. // @Modified build 218 cm19980918 - see below
  4. // @Modified build 252 cm19990114 - added support for useInteractiveProcess
  5. // @Modified build 315 cm19990725 - added support for rmic
  6.  
  7. // This script sets up the tools standard options for for 
  8. // Sun's Java development kit. 
  9.  
  10. var gOutput = getOutput();
  11. var gOptions = getMapFile("JDKToolsStandardOptions");
  12.  
  13. var gBooleanOptions = newList();
  14. gBooleanOptions.addTail("true");
  15. gBooleanOptions.addTail("false");
  16. var includeJDPAOption = true;
  17.  
  18. function DoCommand()
  19. {    
  20.     var JDKOptions = getScriptObject("\\Library\\JDKOptions");
  21.     var classpathUtilities = getScriptObject("\\Library\\classpathUtilities");
  22.     
  23.     var propertyLabelList = newList();
  24.     var propertyList = newList();
  25.     var valueList = newList();
  26.     var actionList = newList();
  27.     
  28.     var propertyName = "runInWindow";
  29.     var propertyValue = gOptions.lookup(propertyName, true);
  30.     propertyLabelList.addTail("Run applications in window ( use javaw )");
  31.     propertyList.addTail(propertyName); 
  32.     valueList.addTail("" + propertyValue);
  33.     actionList.addTail(gBooleanOptions);
  34.     
  35.     var propertyName = "showConsoleWindow";
  36.     var propertyValue = gOptions.lookup(propertyName, false);
  37.     propertyLabelList.addTail("Show application console window");
  38.     propertyList.addTail(propertyName); 
  39.     valueList.addTail("" + propertyValue);
  40.     actionList.addTail(gBooleanOptions);
  41.     
  42.     var propertyName = "useInteractiveProcess";
  43.     var propertyValue = gOptions.lookup(propertyName, true);
  44.     propertyLabelList.addTail("Use Interactive Process");
  45.     propertyList.addTail(propertyName); 
  46.     valueList.addTail("" + propertyValue);
  47.     actionList.addTail(gBooleanOptions);
  48.     
  49.     if (includeJDPAOption)
  50.     {
  51.         var propertyName = "useJPDADebugger";
  52.         var propertyValue = gOptions.lookup(propertyName, false);
  53.         propertyLabelList.addTail("Use JPDA Debugger");
  54.         propertyList.addTail(propertyName); 
  55.         valueList.addTail("" + propertyValue);
  56.         actionList.addTail(gBooleanOptions);
  57.     }
  58.     
  59.     var propertyName = "enableRMICinBuilds";
  60.     var propertyValue = gOptions.lookup(propertyName, false);
  61.     propertyLabelList.addTail("Enable RMIC in builds");
  62.     propertyList.addTail(propertyName); 
  63.     valueList.addTail("" + propertyValue);
  64.     actionList.addTail(gBooleanOptions);
  65.     
  66.     var propertyName = "showAppletConsoleWindow";
  67.     var propertyValue = gOptions.lookup(propertyName, false);
  68.     propertyLabelList.addTail("Show applet console window");
  69.     propertyList.addTail(propertyName); 
  70.     valueList.addTail("" + propertyValue);
  71.     actionList.addTail(gBooleanOptions);
  72.     
  73.     var propertyName = "showCommandLine";
  74.     var propertyValue = gOptions.lookup(propertyName, true);
  75.     propertyLabelList.addTail("Show Generated Command Lines");
  76.     propertyList.addTail(propertyName); 
  77.     valueList.addTail("" + propertyValue);
  78.     actionList.addTail(gBooleanOptions);
  79.     
  80.     var propertyName = "useCommandFileWhenCompiling";
  81.     var propertyValue = gOptions.lookup(propertyName, false);
  82.     propertyLabelList.addTail("Use Command File When Compiling");
  83.     propertyList.addTail(propertyName); 
  84.     valueList.addTail("" + propertyValue);
  85.     actionList.addTail(gBooleanOptions);
  86.     
  87.     var propertyName = "useSpecifiedClasspathsOnly";
  88.     var propertyValue = gOptions.lookup(propertyName, false);
  89.     propertyLabelList.addTail("Use Specified Classpaths Only");
  90.     propertyList.addTail(propertyName); 
  91.     valueList.addTail("" + propertyValue);
  92.     actionList.addTail(gBooleanOptions);
  93.  
  94.     var propertyName = "useEnvironmentClasspath";
  95.     var propertyValue = gOptions.lookup(propertyName, false);
  96.     propertyLabelList.addTail("Use Environment Classpaths Only");
  97.     propertyList.addTail(propertyName); 
  98.     valueList.addTail("" + propertyValue);
  99.     actionList.addTail(gBooleanOptions);
  100.     
  101.     var propertyName = "customClasspaths";
  102.     var propertyValue = gOptions.lookup(propertyName, "");
  103.     propertyLabelList.addTail("Custom Classpaths");
  104.     propertyList.addTail(propertyName); 
  105.     valueList.addTail(propertyValue);
  106.     actionList.addTail(classpathUtilities.EditJDKCustomClasspaths);
  107.     
  108.     var propertyName = "jdk-compiler_debug";
  109.     var propertyValue = gOptions.lookup(propertyName, "-g"); 
  110.     propertyLabelList.addTail("Compiler (javac) debug");
  111.     propertyList.addTail(propertyName);
  112.     valueList.addTail(propertyValue);
  113.     actionList.addTail(JDKOptions.CompileOptions);
  114.     
  115.     var propertyName = "jdk-compiler_release";
  116.     var propertyValue = gOptions.lookup(propertyName, ""); 
  117.     propertyLabelList.addTail("Compiler (javac) release");
  118.     propertyList.addTail(propertyName);
  119.     valueList.addTail(propertyValue);
  120.     actionList.addTail(JDKOptions.CompileOptions);
  121.     
  122.     var propertyName = "jdk-runapplication_debug";
  123.     var propertyValue = gOptions.lookup(propertyName, "");
  124.     propertyLabelList.addTail("Interpreter (java) debug");
  125.     propertyList.addTail(propertyName);
  126.     valueList.addTail(propertyValue);
  127.     actionList.addTail(JDKOptions.RunOptions);
  128.     
  129.     var propertyName = "jdk-runapplication_release";
  130.     var propertyValue = gOptions.lookup(propertyName, "");
  131.     propertyLabelList.addTail("Interpreter (java) release");
  132.     propertyList.addTail(propertyName);
  133.     valueList.addTail(propertyValue);
  134.     actionList.addTail(JDKOptions.RunOptions);
  135.     
  136.     var propertyName = "jdk-runapplicationwindow_debug";
  137.     var propertyValue = gOptions.lookup(propertyName, "");
  138.     propertyLabelList.addTail("Interpreter (javaw) debug");
  139.     propertyList.addTail(propertyName);
  140.     valueList.addTail(propertyValue);
  141.     actionList.addTail(JDKOptions.RunOptions);
  142.     
  143.     var propertyName = "jdk-runapplicationwindow_release";
  144.     var propertyValue = gOptions.lookup(propertyName, "");
  145.     propertyLabelList.addTail("Interpreter (javaw) release");
  146.     propertyList.addTail(propertyName);
  147.     valueList.addTail(propertyValue);
  148.     actionList.addTail(JDKOptions.RunOptions);
  149.     
  150.     var propertyName = "jdk-appletviewer_release";
  151.     var propertyValue = gOptions.lookup(propertyName, "");
  152.     propertyLabelList.addTail("Appletviewer release");
  153.     propertyList.addTail(propertyName);
  154.     valueList.addTail(propertyValue);
  155.     actionList.addTail(JDKOptions.AppletViewerOptions);
  156.     
  157.     var propertyName = "jdk-appletviewer_debug";
  158.     var propertyValue = gOptions.lookup(propertyName, "");
  159.     propertyLabelList.addTail("Appletviewer debug");
  160.     propertyList.addTail(propertyName);
  161.     valueList.addTail(propertyValue);
  162.     actionList.addTail(JDKOptions.AppletViewerOptions);
  163.     
  164.     var propertyName = "jdk-debugger";
  165.     var propertyValue = gOptions.lookup(propertyName, "");
  166.     propertyLabelList.addTail("Debugger (jdb)");
  167.     propertyList.addTail(propertyName);
  168.     valueList.addTail(propertyValue);
  169.     actionList.addTail(JDKOptions.DebuggerOptions);
  170.     
  171.     if (includeJDPAOption)
  172.     {
  173.         var propertyName = "jdk-jdpa_debugger";
  174.         var propertyValue = gOptions.lookup(propertyName, "server=y,address=8000");
  175.         propertyLabelList.addTail("Debugger (jpda)");
  176.         propertyList.addTail(propertyName);
  177.         valueList.addTail(propertyValue);
  178.         actionList.addTail(newList());
  179.     }
  180.     
  181.     var results = editProperties("JDK Options", "Edit options",
  182.         "Option", "Value", propertyLabelList, valueList, actionList);
  183.     
  184.     if (results)
  185.     {
  186.         var propertyPostion = propertyList.getHeadPosition();
  187.         var valuePosition = valueList.getHeadPosition();
  188.         while (propertyPostion.valid && valuePosition.valid)
  189.         {
  190.             var property = propertyList.getNext(propertyPostion);
  191.             var value = valueList.getNext(valuePosition);
  192.             
  193.             // Update the value of the property
  194.             
  195.             if (property == "runInWindow" ||
  196.                 property == "showConsoleWindow" || //cm19980918
  197.                 property == "showAppletConsoleWindow" || //cm19980918
  198.                 property == "showCommandLine" ||
  199.                 property == "useInteractiveProcess" || //cm19990114
  200.                 property == "useJPDADebugger" || //cm20010512
  201.                 property == "enableRMICinBuilds" || //cm19990725
  202.                 property == "useEnvironmentClasspath" ||
  203.                 property == "useSpecifiedClasspathsOnly" || //cm20020325
  204.                 property == "useCommandFileWhenCompiling") //cm20000530
  205.             {
  206.                 // convert value to a boolean
  207.                 if (value == "true")
  208.                 {
  209.                     gOptions.setValue(property, true);
  210.                 }
  211.                 else
  212.                 {
  213.                     gOptions.setValue(property, false);
  214.                 }
  215.             }
  216.             else
  217.             {
  218.                 gOptions.setValue(property, value); 
  219.             }
  220.         }
  221.         
  222.         // Update options
  223.         var jdkOptions = getScriptObject("\\Library\\jdkOptions");
  224.         jdkOptions.UpdateOptions()
  225.         }
  226. }
  227.  
  228. !!/Script
  229.  
  230.  
  231.