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

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3. // @Modified build 480 cm20010124 - removed the '-depend' option
  4.  
  5. // This script sets up the tools options for for Sun's Java 
  6. // development kit. 
  7.  
  8. var gOutput = getOutput();
  9. var helpers = getMapFile("ApplicationHelpers");
  10. var gOptions = getMapFile("JDKToolsStandardOptions");
  11.  
  12. function DoCommand()
  13. {
  14.     alert("The jdkOptions script only contains funtions\nthat can be used by other scripts");
  15. }
  16.  
  17. function ChooseDebugOptions()
  18. {
  19.     var standardOptions = gOptions.lookup("jdk-debugger", "");
  20.     
  21.     var editedOptions = DebugOptions(standardOptions);
  22.     
  23.     if (editedOptions != null)
  24.     {
  25.         gOptions.setValue("jdk-debugger", editedOptions);
  26.     }
  27. }
  28.  
  29. function DebugOptions(value)
  30. {
  31.     // Input value should be a string containing
  32.     // existing options
  33.     
  34.     if (typeof(value) != "string")
  35.     {
  36.         value = "";
  37.     }
  38.     
  39.     // Function must return a string of selected options.
  40.     // Any options not included are appended to the 
  41.     // the end of the returned string.
  42.     
  43.     var list = newList();
  44.     var checked = newList();
  45.     var action = newList();
  46.     
  47.     AddSpecialOption(
  48.     list,
  49.     checked,
  50.     "Show command line",
  51.     "",
  52.         gOptions.lookup("showCommandLine", false),
  53.     action, null);
  54.     
  55.     value = AddOption(
  56.     list,
  57.     checked,
  58.     "Enable recompiling of class file if necessary ( -cs, -checksource )",
  59.     "-cs",
  60.     value,
  61.     action, null);
  62.     
  63.     value = AddOption(
  64.     list,
  65.     checked,
  66.     "Turn off asynchronous garbage collection  ( -noasyncgc )",
  67.     "-noasyncgc",
  68.     value,
  69.     action, null);
  70.     
  71.     value = AddOption(
  72.     list,
  73.     checked,
  74.     "Turn off garbage collection of Java classes ( -noclassgc )",
  75.     "-noclassgc",
  76.     value,
  77.     action, null);
  78.     
  79.     value = AddOption(
  80.     list,
  81.     checked,
  82.     "Enable Java profiling ( -prof )",
  83.     "-prof",
  84.     value,
  85.     action, null);
  86.     
  87.     value = AddOption(
  88.     list,
  89.     checked,
  90.     "Output the build version information.( -version )",
  91.     "-version",
  92.     value,
  93.     action, null);
  94.     
  95.     value = AddOption(
  96.     list,
  97.     checked,
  98.     "Output usage information ( -help )",
  99.     "-help",
  100.     value,
  101.     action, null);
  102.     
  103.     value = AddOption(
  104.     list,
  105.     checked,
  106.     "Output additional information ( -v,-verbose )",
  107.     "-v",
  108.     value,
  109.     action, null);
  110.     
  111.     value = AddOption(
  112.     list,
  113.     checked,
  114.     "Enables the java verifier on all code ( -verify )",
  115.     "-verify",
  116.     value,
  117.     action, null);
  118.     
  119.     value = AddOption(
  120.     list,
  121.     checked,
  122.     "Enables the java verifier (default,  -verifyremote )",
  123.     "-verifyremote",
  124.     value,
  125.     action, null);
  126.     
  127.     value = AddOption(
  128.     list,
  129.     checked,
  130.     "Disable the java verifier. ( -noverify )",
  131.     "-noverify",
  132.     value,
  133.     action, null);
  134.     
  135.     value = AddOption(
  136.     list,
  137.     checked,
  138.     "Enables garbage collector output messages. ( -verbosegc )",
  139.     "-verbosegc",
  140.     value,
  141.     action, null);
  142.     
  143.     var result = chooseOptions("Choose Options",
  144.     "Choose java debug options", list, checked,
  145.     null, true, "Classpaths...", EditClasspaths);
  146.     
  147.     // result is a list of booleans 
  148.     if (result)
  149.     {
  150.         var listPosition = list.getHeadPosition();
  151.         var resultPosition = result.getHeadPosition();
  152.         var returnValue = "";    
  153.         
  154.         var selected = result.getNext(resultPosition);
  155.         var item = list.getNext(listPosition);
  156.         gOptions.setValue("showCommandLine", selected);
  157.         
  158.         while (resultPosition.valid && listPosition.valid)
  159.         {
  160.             selected = result.getNext(resultPosition);
  161.             item = list.getNext(listPosition);
  162.             
  163.             if (selected )
  164.             {
  165.                 // Separate from the previous using a space
  166.                 if (returnValue.length > 0)
  167.                 {
  168.                     returnValue += " ";
  169.                 }
  170.                 returnValue += item.value;
  171.             }
  172.         }
  173.         
  174.         // Add what's left over if there is any non-space data in value
  175.         // Note: the expression "[^ ]" matches the first non-space
  176.         // character in value
  177.         
  178.         if (value.length > 0)
  179.         {
  180.             // Don't add extra spaces
  181.             var nonspace = searchInString(value, "[^ ]");
  182.             if (nonspace)
  183.             {
  184.                 returnValue += " " + 
  185.                 value.substring(nonspace.value, value.length);
  186.             }
  187.         }
  188.         
  189.         return returnValue;
  190.     }
  191.     return null;
  192. }
  193.  
  194. function GetRunOptions()
  195. {
  196.     var options;
  197.     var runInWindow = gOptions.lookup("runInWindow", true);
  198.     if (runInWindow)
  199.     {
  200.         options = gOptions.lookup("jdk-runapplicationwindow", "");
  201.     }
  202.     else
  203.     {
  204.         options = gOptions.lookup("jdk-runapplication", "");
  205.     }
  206.     
  207.     return options;
  208. }
  209.  
  210. function ChooseRunOptions()
  211. {
  212.     var standardOptions;
  213.     var runInWindow = gOptions.lookup("runInWindow", true);
  214.     if (runInWindow)
  215.     {
  216.         standardOptions = gOptions.lookup("jdk-runapplicationwindow", "");
  217.     }
  218.     else
  219.     {
  220.         standardOptions = gOptions.lookup("jdk-runapplication", "");
  221.     }
  222.     
  223.     var editedOptions = RunOptions(standardOptions);
  224.     
  225.     if (editedOptions != null)
  226.     {
  227.         // Get the value again because RunOptions may have changed it
  228.         runInWindow = gOptions.lookup("runInWindow", true);
  229.         if (runInWindow)
  230.         {
  231.             gOptions.setValue("jdk-runapplicationwindow", editedOptions);
  232.         }
  233.         else
  234.         {
  235.             gOptions.setValue("jdk-runapplication", editedOptions);
  236.         }
  237.     }
  238. }
  239.  
  240. function RunOptions(value)
  241. {
  242.     // Input value should be a string containing
  243.     // existing options
  244.     
  245.     if (typeof(value) != "string")
  246.     {
  247.         value = "";
  248.     }
  249.     
  250.     // Function must return a string of selected options.
  251.     // Any options not included are appended to the 
  252.     // the end of the returned string.
  253.     
  254.     var list = newList();
  255.     var checked = newList();
  256.     var action = newList();
  257.     
  258.     AddSpecialOption(
  259.     list,
  260.     checked,
  261.     "Show command line",
  262.     "",
  263.         gOptions.lookup("showCommandLine", false),
  264.     action, null);
  265.     
  266.     AddSpecialOption(
  267.     list,
  268.     checked,
  269.     "Run in window ( use javaw )",
  270.     "",
  271.     gOptions.lookup("runInWindow", false),
  272.     action, null);
  273.     
  274.     AddSpecialOption(
  275.     list,
  276.     checked,
  277.     "Show console window",
  278.     "",
  279.     gOptions.lookup("showConsoleWindow", false),
  280.     action, null);
  281.     
  282.     AddSpecialOption(
  283.     list,
  284.     checked,
  285.     "Use interactive process",
  286.     "",
  287.     gOptions.lookup("useInteractiveProcess", true),
  288.     action, null);
  289.  
  290.     AddSpecialOption(
  291.     list,
  292.     checked,
  293.     "Enable RMIC in builds",
  294.     "",
  295.     gOptions.lookup("enableRMICinBuilds", false),
  296.     action, null);
  297.  
  298.     value = AddOption(
  299.     list,
  300.     checked,
  301.     "Enable jdb to attach itself to this session ( -debug )",
  302.     "-debug",
  303.     value,
  304.     action, null);
  305.     
  306.     value = AddOption(
  307.     list,
  308.     checked,
  309.     "Enable recompiling of class file if necessary ( -cs, -checksource )",
  310.     "-cs",
  311.     value,
  312.     action, null);
  313.     
  314.     value = AddOption(
  315.     list,
  316.     checked,
  317.     "Turn off asynchronous garbage collection  ( -noasyncgc )",
  318.     "-noasyncgc",
  319.     value,
  320.     action, null);
  321.     
  322.     value = AddOption(
  323.     list,
  324.     checked,
  325.     "Turn off garbage collection of Java classes ( -noclassgc )",
  326.     "-noclassgc",
  327.     value,
  328.     action, null);
  329.     
  330.     value = AddOption(
  331.     list,
  332.     checked,
  333.     "Enable Java profiling ( -prof )",
  334.     "-prof",
  335.     value,
  336.     action, null);
  337.     
  338.     value = AddOption(
  339.     list,
  340.     checked,
  341.     "Output the build version information.( -version )",
  342.     "-version",
  343.     value,
  344.     action, null);
  345.     
  346.     value = AddOption(
  347.     list,
  348.     checked,
  349.     "Output usage information ( -help )",
  350.     "-help",
  351.     value,
  352.     action, null);
  353.     
  354.     value = AddOption(
  355.     list,
  356.     checked,
  357.     "Turn method tracing on (java_g only ) ( -tm )",
  358.     "-tm",
  359.     value,
  360.     action, null);
  361.     
  362.     value = AddOption(
  363.     list,
  364.     checked,
  365.     "Turn instruction tracing on (java_g only - huge output) ( -t )",
  366.     "-t",
  367.     value,
  368.     action, null);
  369.     
  370.     value = AddOption(
  371.     list,
  372.     checked,
  373.     "Output additional information ( -v,-verbose )",
  374.     "-v",
  375.     value,
  376.     action, null);
  377.     
  378.     value = AddOption(
  379.     list,
  380.     checked,
  381.     "Enables the java verifier on all code ( -verify )",
  382.     "-verify",
  383.     value,
  384.     action, null);
  385.     
  386.     value = AddOption(
  387.     list,
  388.     checked,
  389.     "Enables the java verifier (default,  -verifyremote )",
  390.     "-verifyremote",
  391.     value,
  392.     action, null);
  393.     
  394.     value = AddOption(
  395.     list,
  396.     checked,
  397.     "Disable the java verifier. ( -noverify )",
  398.     "-noverify",
  399.     value,
  400.     action, null);
  401.     
  402.     value = AddOption(
  403.     list,
  404.     checked,
  405.     "Enables garbage collector output messages. ( -verbosegc )",
  406.     "-verbosegc",
  407.     value,
  408.     action, null);
  409.     
  410.     value = AddOption(
  411.     list,
  412.     checked,
  413.     "Sets the maximum size of the memory allocation pool to 16m. (-mx16m )",
  414.     "-mx16m",
  415.     value,
  416.     action, null);
  417.     
  418.     value = AddOption(
  419.     list,
  420.     checked,
  421.     "Sets the startup size of the memory allocation pool to 1m. (-ms1m )",
  422.     "-ms1m",
  423.     value,
  424.     action, null);
  425.     
  426.     var result = chooseOptions("Choose Options",
  427.     "Choose java runtime options", list, checked,
  428.     null, true, "Classpaths...", EditClasspaths);
  429.     
  430.     // result is a list of booleans 
  431.     if (result)
  432.     {
  433.         var listPosition = list.getHeadPosition();
  434.         var resultPosition = result.getHeadPosition();
  435.         var returnValue = "";
  436.         
  437.         var selected = result.getNext(resultPosition);
  438.         var item = list.getNext(listPosition);
  439.         gOptions.setValue("showCommandLine", selected);
  440.         
  441.         selected = result.getNext(resultPosition);
  442.         item = list.getNext(listPosition);
  443.         gOptions.setValue("runInWindow", selected);
  444.         
  445.         selected = result.getNext(resultPosition);
  446.         item = list.getNext(listPosition);
  447.         gOptions.setValue("showConsoleWindow", selected);
  448.         
  449.         selected = result.getNext(resultPosition);
  450.         item = list.getNext(listPosition);
  451.         gOptions.setValue("useInteractiveProcess", selected);
  452.  
  453.         selected = result.getNext(resultPosition);
  454.         item = list.getNext(listPosition);
  455.         gOptions.setValue("enableRMICinBuilds", selected);
  456.  
  457.         while (resultPosition.valid && listPosition.valid)
  458.         {
  459.             selected = result.getNext(resultPosition);
  460.             item = list.getNext(listPosition);
  461.             
  462.             if (selected )
  463.             {
  464.                 // Separate from the previous using a space
  465.                 if (returnValue.length > 0)
  466.                 {
  467.                     returnValue += " ";
  468.                 }
  469.                 returnValue += item.value;
  470.             }
  471.         }
  472.         
  473.         // Add what's left over if there is any non-space data in value
  474.         // Note: the expression "[^ ]" matches the first non-space
  475.         // character in value
  476.         
  477.         if (value.length > 0)
  478.         {
  479.             // Don't add extra spaces
  480.             var nonspace = searchInString(value, "[^ ]");
  481.             if (nonspace)
  482.             {
  483.                 returnValue += " " + 
  484.                 value.substring(nonspace.value, value.length);
  485.             }
  486.         }
  487.         return returnValue;
  488.     }
  489.     return null;
  490. }
  491.  
  492. function EditClasspaths()
  493. {
  494.     var classpaths = gOptions.lookup("customClasspaths", ""); 
  495.     var classpathUtilities = getScriptObject("\\Library\\classpathUtilities");
  496.     
  497.     var newclasspaths = classpathUtilities.EditClasspaths(
  498.     "Edit JDK custom classpaths (do not add a path for classes.zip)",
  499.     classpaths);
  500.     gOptions.setValue("customClasspaths", newclasspaths); 
  501. }
  502.  
  503. function CompileOptions(value)
  504. {
  505.     // Input value should be a string containing
  506.     // existing options
  507.     
  508.     if (typeof(value) != "string")
  509.     {
  510.         return value;
  511.     }
  512.     
  513.     // Function must return a string of selected options.
  514.     // Any options not included are appended to the 
  515.     // the end of the returned string.
  516.     
  517.     var list = newList();
  518.     var checked = newList();
  519.     var action = newList();
  520.     
  521.     // debugging tables
  522.     value = AddOption(
  523.     list,
  524.     checked,
  525.     "Output deprecated API messages ( -deprecation )",
  526.     "-deprecation",
  527.     value,
  528.     action, null);
  529.     
  530.     // debugging tables
  531.     value = AddOption(
  532.     list,
  533.     checked,
  534.     "Enable generation of debugging table ( -g )",
  535.     "-g",
  536.     value,
  537.     action, null);
  538.     
  539.     // warnings
  540.     value = AddOption(
  541.     list,
  542.     checked,
  543.     "Turn off warnings ( -nowarn )",
  544.     "-nowarn",
  545.     value,
  546.     action, null);
  547.     
  548.     // optimiation
  549.     value = AddOption(
  550.     list,
  551.     checked,
  552.     "Optimize generated code ( -O )",
  553.     "-O",
  554.     value,
  555.     action, null);
  556.     
  557.     // verbose
  558.     value = AddOption(
  559.     list,
  560.     checked,
  561.     "Output additional information ( -verbose )",
  562.     "-verbose",
  563.     value,
  564.     action, null);
  565.     
  566.     var result = chooseOptions("Choose Options",
  567.     "Choose compile options", list, checked);
  568.     
  569.     // result is a list of booleans 
  570.     if (result)
  571.     {
  572.         var listPosition = list.getHeadPosition();
  573.         var resultPosition = result.getHeadPosition();
  574.         var returnValue = "";
  575.         while (resultPosition.valid && listPosition.valid)
  576.         {
  577.             var selected = result.getNext(resultPosition);
  578.             var item = list.getNext(listPosition);
  579.             
  580.             if (selected)
  581.             {
  582.                 // Separate from the previous using a space
  583.                 if (returnValue.length > 0)
  584.                 {
  585.                     returnValue += " ";
  586.                 }
  587.                 returnValue += item.value;
  588.             }
  589.         }
  590.         
  591.         // Add what's left over if there is any non-space data in value
  592.         // Note: the expression "[^ ]" matches the first non-space
  593.         // character in value
  594.         
  595.         if (value.length > 0)
  596.         {
  597.             // Don't add extra spaces
  598.             var nonspace = searchInString(value, "[^ ]");
  599.             if (nonspace)
  600.             {
  601.                 returnValue += " " + 
  602.                 value.substring(nonspace.value, value.length);
  603.             }
  604.         }
  605.         return returnValue;
  606.     }
  607.     return null;
  608. }
  609.  
  610.  
  611. function AppletViewerOptions(value)
  612. {
  613.     // Input value should be a string containing
  614.     // existing options
  615.     
  616.     if (typeof(value) != "string")
  617.     {
  618.         return value;
  619.     }
  620.     
  621.     // Function must return a string of selected options.
  622.     // Any options not included are appended to the 
  623.     // the end of the returned string.
  624.     
  625.     var list = newList();
  626.     var checked = newList();
  627.     var action = newList();
  628.     
  629.     // debugging tables
  630.     value = AddOption(
  631.     list,
  632.     checked,
  633.     "Start the appletviewer in the debugger ( -debug  )",
  634.     "-debug ",
  635.     value,
  636.     action, null);
  637.     
  638.     var result = chooseOptions("Choose Options",
  639.     "Choose appletviewer options", list, checked);
  640.     
  641.     // result is a list of booleans 
  642.     if (result)
  643.     {
  644.         var listPosition = list.getHeadPosition();
  645.         var resultPosition = result.getHeadPosition();
  646.         var returnValue = "";
  647.         while (resultPosition.valid && listPosition.valid)
  648.         {
  649.             var selected = result.getNext(resultPosition);
  650.             var item = list.getNext(listPosition);
  651.             
  652.             if (selected)
  653.             {
  654.                 // Separate from the previous using a space
  655.                 if (returnValue.length > 0)
  656.                 {
  657.                     returnValue += " ";
  658.                 }
  659.                 returnValue += item.value;
  660.             }
  661.         }
  662.         
  663.         // Add what's left over if there is any non-space data in value
  664.         // Note: the expression "[^ ]" matches the first non-space
  665.         // character in value
  666.         
  667.         if (value.length > 0)
  668.         {
  669.             // Don't add extra spaces
  670.             var nonspace = searchInString(value, "[^ ]");
  671.             if (nonspace)
  672.             {
  673.                 returnValue += " " + 
  674.                 value.substring(nonspace.value, value.length);
  675.             }
  676.         }
  677.         return returnValue;
  678.     }
  679.     return null;
  680. }
  681.  
  682. function DebuggerOptions(value)
  683. {
  684.     // Input value should be a string containing
  685.     // existing options
  686.     
  687.     if (typeof(value) != "string")
  688.     {
  689.         return value;
  690.     }
  691.     
  692.     // Function must return a string of selected options.
  693.     // Any options not included are appended to the 
  694.     // the end of the returned string.
  695.     
  696.     var list = newList();
  697.     var checked = newList();
  698.     var action = newList();
  699.     
  700.     value = AddOption(
  701.     list,
  702.     checked,
  703.     "Enable recompiling of class file if necessary ( -cs, -checksource )",
  704.     "-cs",
  705.     value,
  706.     action, null);
  707.     
  708.     value = AddOption(
  709.     list,
  710.     checked,
  711.     "Turn off asynchronous garbage collection  ( -noasyncgc )",
  712.     "-noasyncgc",
  713.     value,
  714.     action, null);
  715.     
  716.     value = AddOption(
  717.     list,
  718.     checked,
  719.     "Turn off garbage collection of Java classes ( -noclassgc )",
  720.     "-noclassgc",
  721.     value,
  722.     action, null);
  723.     
  724.     value = AddOption(
  725.     list,
  726.     checked,
  727.     "Enable Java profiling ( -prof )",
  728.     "-prof",
  729.     value,
  730.     action, null);
  731.     
  732.     value = AddOption(
  733.     list,
  734.     checked,
  735.     "Output the build version information.( -version )",
  736.     "-version",
  737.     value,
  738.     action, null);
  739.     
  740.     value = AddOption(
  741.     list,
  742.     checked,
  743.     "Output usage information ( -help )",
  744.     "-help",
  745.     value,
  746.     action, null);
  747.     
  748.     value = AddOption(
  749.     list,
  750.     checked,
  751.     "Turn tracing on (java_g only ) ( -t )",
  752.     "-t",
  753.     value,
  754.     action, null);
  755.     
  756.     value = AddOption(
  757.     list,
  758.     checked,
  759.     "Output additional information ( -v,-verbose )",
  760.     "-v",
  761.     value,
  762.     action, null);
  763.     
  764.     value = AddOption(
  765.     list,
  766.     checked,
  767.     "Enables the java verifier on all code ( -verify )",
  768.     "-verify",
  769.     value,
  770.     action, null);
  771.     
  772.     value = AddOption(
  773.     list,
  774.     checked,
  775.     "Enables the java verifier (default,  -verifyremote )",
  776.     "-verifyremote",
  777.     value,
  778.     action, null);
  779.     
  780.     value = AddOption(
  781.     list,
  782.     checked,
  783.     "Disable the java verifier. ( -noverify )",
  784.     "-noverify",
  785.     value,
  786.     action, null);
  787.     
  788.     value = AddOption(
  789.     list,
  790.     checked,
  791.     "Enables garbage collector output messages. ( -verbosegc )",
  792.     "-verbosegc",
  793.     value,
  794.     action, null);
  795.     
  796.     var result = chooseOptions("Choose Options",
  797.     "Choose java runtime options", list, checked);
  798.     
  799.     // result is a list of booleans 
  800.     if (result)
  801.     {
  802.         var listPosition = list.getHeadPosition();
  803.         var resultPosition = result.getHeadPosition();
  804.         var returnValue = "";
  805.         while (resultPosition.valid && listPosition.valid)
  806.         {
  807.             var selected = result.getNext(resultPosition);
  808.             var item = list.getNext(listPosition);
  809.             
  810.             if (selected)
  811.             {
  812.                 // Separate from the previous using a space
  813.                 if (returnValue.length > 0)
  814.                 {
  815.                     returnValue += " ";
  816.                 }
  817.                 returnValue += item.value;
  818.             }
  819.         }
  820.         
  821.         // Add what's left over if there is any non-space data in value
  822.         // Note: the expression "[^ ]" matches the first non-space
  823.         // character in value
  824.         
  825.         if (value.length > 0)
  826.         {
  827.             // Don't add extra spaces
  828.             var nonspace = searchInString(value, "[^ ]");
  829.             if (nonspace)
  830.             {
  831.                 returnValue += " " + 
  832.                 value.substring(nonspace.value, value.length);
  833.             }
  834.         }
  835.         return returnValue;
  836.     }
  837.     return null;
  838. }
  839.  
  840. // Use this function to add a command line option 
  841. // when preparing to use the editProperties dialog
  842. function AddOption(optionsList, checkedList, 
  843. option, optionValue, 
  844. optionString,
  845. actionList, action)
  846. {
  847.     if (typeof(optionString) == "string")
  848.     {
  849.         optionsList.addTail(newAssociation(option, optionValue));
  850.         var index1 = optionString.indexOf(optionValue + " ");
  851.         var index2 = optionString.indexOf(optionValue);
  852.         if (index1 != -1)
  853.         {
  854.             checkedList.addTail(true);
  855.             
  856.             // Remove this option from the list
  857.             optionString = replaceInString(optionString, index1, 
  858.             optionValue.length, "");
  859.         }
  860.         else if (index2 != -1 && index2 + optionValue.length == optionString.length)
  861.         {
  862.             checkedList.addTail(true);
  863.             
  864.             // Remove this option from the list
  865.             optionString = replaceInString(optionString, index2, 
  866.             optionValue.length, "");
  867.         }
  868.         else
  869.         {
  870.             checkedList.addTail(false);
  871.         }
  872.     }
  873.     
  874.     if (actionList)
  875.     {
  876.         actionList.addTail(action);
  877.     }
  878.     
  879.     return optionString;
  880. }
  881.  
  882. // Use this function to add a special command line option 
  883. // when preparing to use the editProperties dialog
  884. function AddSpecialOption(optionsList, checkedList, 
  885. option, optionValue, 
  886. checkOn,
  887. actionList, action)
  888. {
  889.     optionsList.addTail(newAssociation(option, optionValue));
  890.     checkedList.addTail(checkOn);
  891.     
  892.     if (actionList)
  893.     {
  894.         actionList.addTail(action);
  895.     }
  896. }
  897.  
  898. function UpdateOptions()
  899. {
  900.     var buildmode = gOptions.lookup("jdk-buildmode", "release");
  901.     if (buildmode == "release")
  902.     {
  903.         // Update tools
  904.         var compilePath = helpers.lookup("jdk-compiler_release", null);
  905.         helpers.setValue("jdk-compiler", compilePath);
  906.         var appletviewerPath = helpers.lookup("jdk-appletviewer_release", null);
  907.         helpers.setValue("jdk-appletviewer", appletviewerPath);
  908.         var runApplicationPath = helpers.lookup("jdk-runapplication_release", null);
  909.         helpers.setValue("jdk-runapplication", runApplicationPath);
  910.         var runApplicationWindowPath = helpers.lookup("jdk-runapplicationwindow_release", null);
  911.         helpers.setValue("jdk-runapplicationwindow", runApplicationWindowPath);
  912.         
  913.         // Update tool options
  914.         var compileOptions = gOptions.lookup("jdk-compiler_release", "");
  915.         gOptions.setValue("jdk-compiler",compileOptions);
  916.         var appletviewerOptions = gOptions.lookup("jdk-appletviewer_release", "");
  917.         gOptions.setValue("jdk-appletviewer",appletviewerOptions);
  918.         var runApplicationOptions = gOptions.lookup("jdk-runapplication_release", "");
  919.         gOptions.setValue("jdk-runapplication",runApplicationOptions);
  920.         var runApplicationWindowOptions = gOptions.lookup("jdk-runapplicationwindow_release", "");
  921.         gOptions.setValue("jdk-runapplicationwindow",runApplicationWindowOptions);
  922.     }
  923.     
  924.     if (buildmode == "debug")
  925.     {
  926.         // Update tools
  927.         var compilePath = helpers.lookup("jdk-compiler_debug", null);
  928.         helpers.setValue("jdk-compiler", compilePath);
  929.         var appletviewerPath = helpers.lookup("jdk-appletviewer_debug", null);
  930.         helpers.setValue("jdk-appletviewer", appletviewerPath);
  931.         var runApplicationPath = helpers.lookup("jdk-runapplication_debug", null);
  932.         helpers.setValue("jdk-runapplication", runApplicationPath);
  933.         var runApplicationWindowPath = helpers.lookup("jdk-runapplicationwindow_debug", null);
  934.         helpers.setValue("jdk-runapplicationwindow", runApplicationWindowPath);
  935.         
  936.         // Update tool options
  937.         var compileOptions = gOptions.lookup("jdk-compiler_debug", "-g");
  938.         gOptions.setValue("jdk-compiler",compileOptions);
  939.         var appletviewerOptions = gOptions.lookup("jdk-appletviewer_debug", "");
  940.         gOptions.setValue("jdk-appletviewer",appletviewerOptions);
  941.         var runApplicationOptions = gOptions.lookup("jdk-runapplication_debug", "");
  942.         gOptions.setValue("jdk-runapplication",runApplicationOptions);
  943.         var runApplicationWindowOptions = gOptions.lookup("jdk-runapplicationwindow_debug", "");
  944.         gOptions.setValue("jdk-runapplicationwindow",runApplicationWindowOptions);
  945.     }
  946. }
  947.  
  948. !!/Script
  949.