XML output element describe the behaviour of the Finish button of the Wizard page. With output you can :
Those behaviours are defined inside ouput element :
<component> ... <!-- Output page --> <output> ... </output> </component>
output element support sequence of file and command. With sequence of file, you can generate, update sseveral files with same Eclipse wizard page. For more information, go at Multiple output section.
file elements must be included into ouput element.
<component> ... <!-- Output page --> <output> <file> ... </file> ... </output> </component>
With file element you can :
Attribute name | Description | Required ? |
key | refer to key model. This attribute is used when file must be updated. | No |
condition | Call javascript fonction which return true if code generation must be done and false otherwise. | No |
outputBaseDir | XUL contrĂ´le ID which define output directory (used into code generation). By default this attribute has outputBaseDir value. | No |
outputFileName | XUL contrĂ´le ID which define output file name (used into code generation). By default this attribute has outputFileName value. | No |
append | This attribute works if key is filled. true if generated content by template must be appended into file (filled with key). | No |
command elements must be included into ouput element.
<component> ... <!-- Output page --> <output> <command> ... </command> ... </output> </component>
For more information about command, go at Command section.
output element can contain several file and command. It's possible to generate several files with same Eclipse wizard page.
In the case of multiple file generation, output directory and file name to generate must be distinct. To do that you must use outputBaseDir and outputFileName attribute to distinguish output directory and file name to generate between file :
<output> <file> <template uri="/ftl/Xul/Textbox.ftl" /> </file> <file outputBaseDir="outputBaseDir2" outputFileName="outputFileName2"> <template uri="/ftl/Xul/Textbox.ftl" /> </file> </output>
In the below sample, output directory and first file name to generate will be use values of texboxes with outputBaseDir and outputFileName ID's. Output directory and second file name to generate will be use values of texboxes outputBaseDir2 and outputFileName2 ID's.
It's possible to set condition to launch code generation. This condition can be managed with script.
For instance it's possible to display checkbox to check if code generation must be done or not :
To do that, before defining checkox with checkoxParam ID :
<checkbox id="checkoxParam" flex="1" checked="true" label="must launch file generation?" />
You must se condition on file element :
<output> <file condition="javascript:mustLaunchFileGeneration();"> <template uri="/ftl/Xul/Textbox.ftl" /> </file> </output>
condition attrinute call mustLaunchFileGeneration javascript function :
<script type="text/javascript" > function mustLaunchFileGeneration() { var /* checkbox */ checkoxParam = document.getElementById('checkoxParam'); return checkoxParam.checked; } </script>
This javascript function return true if checkbox with checkoxParam ID is checked (code generation must be done) and false otherwise (code generation must not be done).