The content of Wizard page of XML component is described with XUL. Parameters which are used into the template of XML component are described with XUL controls.
The id attribute of the XUL control is mapped with the parameter name used into the template.
You can find samples with XUL controls into usecases-catalog/Components/Xul catalog.
For more information about XUL syntax, you can see the mozilla web site.
This section organize XUL elements like this :
XUL controls events call javascript functions. javascript: namespace must be setted before function name to call like this :
<textbox id="textboxParam" oninput="javascript:validate();" />
validate is javascript function to call when XUL control value is updated.
The XUL description :
<label value="Textbox parameter:" /> <textbox id="textboxParam" flex="1" />
generate SWT interface :
Here XUL control attributes :
attribute name | Description | Required ? |
id | XUL control ID, used with template and script (see document.getElementById(id)). | Yes |
value | Textbox value. | No |
readonly | true if control must be readonly and false otherwise. | No |
disabled | true if control must be disabled and false otherwise. | No |
Here XUL control events attributes :
attribute name | Description | Required ? |
onkeyup | Contain script which is fired on keyup. | No |
oninput | Contain script which is fired when control value is updated. | No |
Here Freemarker template sample :
Textbox parameter: ${textboxParam}
Click on Freemarker, Velocity, XSLT section to use this XUL control value into template.
Click on script section to manage this XUL control with Javascript.
The XUL description :
<checkbox id="checkboxParam" checked="true" label="Checkbox parameter" flex="1" />
generate SWT interface :
Here XUL control attributes :
attribute name | Description | Required ? |
id | XUL control ID, used with template and script (see document.getElementById(id)). | Yes |
label | Checkbox label | No |
checked | true if checkbox must be checked and false otherwise. | No |
disabled | true if control must be disabled and false otherwise. | No |
Here XUL control events attributes :
attribute name | Description | Required ? |
oncommand | Contain script when control is checked/unchecked. | No |
Here Freemarker template sample :
Checkbox parameter is <#if checkboxParam >checked<#else>not checked</#if>
Click on Freemarker, Velocity, XSLT section to use this XUL control value into template.
Click on script section to manage this XUL control with Javascript.
The XUL description :
<radio id="radio1Param" label="radio 1"/> <radio id="radio2Param" selected="true" label="radio 2"/> <radio id="radio3Param" label="radio 3"/>
Here XUL control attributes :
attribute name | Description | Required ? |
id | XUL control ID, used with template and script (see document.getElementById(id)). | Yes |
label | Radio label | No |
value | Radio value (used into template). | Yes |
selected | true if radio must be selected and false otherwise. | No |
disabled | true if control must be disabled and false otherwise. | No |
generate SWT interface :
Here Freemarker template sample :
radio 1 is <#if radio1Param >selected<#else>not selected</#if> radio 2 is <#if radio2Param >selected<#else>not selected</#if> radio 3 is <#if radio3Param >selected<#else>not selected</#if>
Click on Freemarker, Velocity, XSLT section to use this XUL control value into template.
Click on script section to manage this XUL control with Javascript.
The XUL description :
<radiogroup flex="1" id="radios" > <radio value="radio1Value" label="radio 1" /> <radio value="radio2Value" selected="true" label="radio 2"/> <radio value="radio3Value" label="radio 3"/> </radiogroup>
generate SWT interface :
Here XUL control attributes :
Nom attribut | Description | Obligatoire ? |
id | XUL control ID, used with template and script (see document.getElementById(id)). | Yes |
orient | vertical if radios must be vertically displayed and horizontal if radios must be horizontally displayed. By default orient="vertical" | No |
Here XUL control events attributes :
attribute name | Description | Required ? |
onchange | Contain script when radio is checked/unchecked. | No |
Here Freemarker template sample :
Radio value selected : ${radios}
Click on Freemarker, Velocity, XSLT section to use this XUL control value into template.
Click on script section to manage this XUL control with Javascript.
The XUL description :
<label value="firstCombo:" /> <menulist id="firstCombo" editable="true" > <menupopup> <menuitem label="Car"/> <menuitem label="Taxi"/> <menuitem label="Bus" selected="true"/> <menuitem label="Train"/> </menupopup> </menulist>
generate SWT interface :
Here XUL control (menulist) attributes :
attribute name | Description | Required ? |
id | XUL control ID, used with template and script (see document.getElementById(id)). | Yes |
editable | true if menulist must be editable and false otherwise. | No |
disabled | true if control must be disabled and false otherwise. | No |
Here XUL control events attributes :
attribute name | Description | Required ? |
onchange | Contain script when item is selected. | No |
oninput | Contain script when control value (editable="true") is updated. | No |
Here Freemarker template sample :
Value of first combo: ${firstCombo}
Click on Freemarker, Velocity, XSLT section to use this XUL control value into template.
Click on script section to manage this XUL control with Javascript.
The XUL description :
<tree id="treeParam" checked="true" flex="1" > <treecols> <treecol label="Fields" flex="1"/> </treecols> <treechildren> <treeitem checked="true" > <treerow> <treecell label="field 1" /> </treerow> </treeitem> <treeitem> <treerow> <treecell label="field 2" /> </treerow> </treeitem> </treechildren> </tree>
generate SWT interface :
Here XUL control (tree) attributes :
attribute name | Description | Required ? |
id | XUL control ID, used with template and script (see document.getElementById(id)). | Yes |
Here Freemarker template sample :
<#if treeParam?is_hash >fields is Map</#if> List of tree item selected : <#list treeParam?keys as key>${key} </#list>
Click on Freemarker, Velocity, XSLT section to use this XUL control value into template.
Click on script section to manage this XUL control with Javascript.
XUL description :
<listbox id="fields" flex="1" linesVisible="true" seltype="multiple" > <listhead> <listheader label="Field name" /> <listheader label="Field type" /> </listhead> <listcols> <listcol flex="1" /> <listcol flex="1"> <listcolitem label="java.lang.String" /> <listcolitem label="java.lang.Integer" /> <listcolitem label="java.util.Date" /> </listcol> </listcols> <listitem> <listcell label="name" ></listcell> <listcell label="java.lang.String" ></listcell> </listitem> <listitem> <listcell label="login" ></listcell> <listcell label="java.lang.String" ></listcell> </listitem> </listbox>
generate SWT interface :
Here XUL control (listbox) attributes :
attribute name | Description | Required ? |
id | XUL control ID, used with template and script (see document.getElementById(id)). | Yes |
linesVisible | true if listbox must display lines and false otherwise. | No |
seltype | multiple if several lines can be selected and false otherwise. | No |
Here Freemarker template sample :
<#assign itemCount = fields.getItemCount() /> <#-- Fields declaration --> <#if itemCount != 0 > <#list 0..itemCount -1 as i> <#assign tableItem = fields.getItem(i) /> <#assign fieldName = tableItem.getText(0) /> <#assign fieldType = tableItem.getText(1) /> private ${fieldType} ${fieldName}; </#list> </#if>
Click on Freemarker, Velocity, XSLT section to use this XUL control value into template.
Click on script section to manage this XUL control with Javascript.
XUL button is written like this :
<button label="OK" />
Here XUL control attributes :
attribute name | Description | Required ? |
label | Button label | No |
type | Button type (folder, package,...). See next sections to understand it. | No |
oncommand | Event onclick. It is used with javascript function | No |
Akrogen define several type of buttons which is determinated with type attribute.
This button type open the folder selection window of your Eclipse project :
This button is linked to XUL control with target attribute. This textbox will contain the selected folder.
The XUL description :
<label value="folderName:" /> <textbox id="folderName" flex="1" /> <button type="folder" target="folderName" label="Browse..." />
generate SWT interface :
This button type open the package selection window of your Eclipse project :
This button is linked to XUL control with target attribute. This textbox will contain the selected package.
The XUL description :
<label value="packageName:" /> <textbox id="packageName" flex="1" /> <button type="package" target="packageName" label="Browse..." />
generate SWT interface :
This button type open the source selection window of your Eclipse project :
This button is linked to XUL control with target attribute. This textbox will contain the selected source.
The XUL description :
<label value="sourceName:" /> <textbox id="sourceName" flex="1" /> <button type="source" target="sourceName" label="Browse..." />
generate SWT interface :
This button type open the class JAVA selection window of your Eclipse project :
This button is linked to XUL control with target attribute. This textbox will contain the selected class.
XUL description :
<label value="className:" /> <textbox id="className" flex="1" /> <button type="class" target="className" label="Browse..." />
generate SWT interface :
This button type is used to preview the generated code :
The XUL description :
<button type="preview" label="Preview..." />
generate SWT interface :
The XUL description :
<tabbox> <tabs> <tab label="title/description" /> <tab label="model" /> <tab label="input" selected="true" /> <tab label="output"/> </tabs> <tabpanels> <!-- Title/Description --> <tabpanel id="title_description_tabpanel" orient="vertical"> <!-- ...Tab panel content --> </tabpanel> <!-- Model --> <tabpanel id="model_tabpanel" orient="vertical"> <!-- ...Tab panel content --> </tabpanel> <!-- Input --> <tabpanel id="input_tabpanel" orient="vertical"> <!-- ...Tab panel content --> </tabpanel> <!-- Output --> <tabpanel id="output_tabpanel" orient="vertical"> <!-- ...Tab panel content --> </tabpanel> </tabpanels> </tabbox>
generate SWT interface :
Here XUL control events attributes (on tabs element):
Nom attribut | Description | Obligatoire ? |
onselect | Contain script which is fired when tab is selected. | No |
The XUL description :
<groupbox orient="horizontal" flex="1"> <caption label="Search Criteria"/> <!-- ... XUL content --> </groupbox>
generate SWT interface :