Code templates are code fragments that can be inserted at the current editing position. Oxygen XML Author Eclipse plugin includes a set of built-in templates for CSS, Schematron, XSL, XQuery, JSON, HTML, and XML Schema document types. You can also define your own code templates for any type of file and share them with your colleagues using the template export and import functions.
To configure Code Templates, open the Preferences dialog box and go to .
This preferences page contains a list of all the available code templates (both built-in and custom created ones) and a code preview area. You can disable any code template by deselecting it.
The following actions are available:
Insert Editor
Variables button.
Insert Editor
Variables button.${ask( 'Provide a date',generic,'${date(yyyy-MM-dd'T'HH:MM)}')}| Parameter | |
|---|---|
| generic (default) | Format: ${ask('message', generic, 'default')} |
| Description: The input is considered to be generic text that requires no special handling. | |
Example:
|
|
| url | Format: ${ask('message', url, 'default_value')} |
| Description: Input is considered a URL. Oxygen XML Author Eclipse plugin checks that the provided URL is valid. | |
Example:
|
|
| relative_url | Format: ${ask('message', relative_url, 'default')} |
| Description: Input is considered a URL. This parameter provides a
file chooser, along with a text field. Oxygen XML Author Eclipse plugin tries to make
the URL relative to that of the document you are editing. Note: If the $ask editor variable is expanded in
content that is not yet saved (such as an untitled file, whose path
cannot be determined), then Oxygen XML Author Eclipse plugin will transform it into an
absolute URL.
|
|
|
Example: ${ask('File location', relative_url, 'C:/example.txt')} - The dialog box has the name 'File location'. The URL inserted in the input box is made relative to the currently edited document location. |
|
| password | Format: ${ask('message', password, 'default')} |
| Description: The input is hidden with bullet characters. | |
Example:
|
|
| combobox | Format: ${ask('message', combobox, ('real_value1':'rendered_value1';...;'real_valueN':'rendered_valueN'), 'default')} |
| Description: Displays a dialog box that offers a drop-down menu.
The drop-down menu is populated with the given rendered_value values.
Choosing such a value will return its associated value
(real_value). Note: The list of
'real_value':'rendered_value' pairs can be computed using
${xpath_eval()}.
Note: The
'default' parameter specifies the default-selected value and can
match either a key or a value.
|
|
Example:
|
|
| editable_combobox | Format: ${ask('message', editable_combobox, ('real_value1':'rendered_value1';...;'real_valueN':'rendered_valueN'), 'default')} |
| Description: Displays a dialog box that offers a drop-down menu
with editable elements. The drop-down menu is populated with the given
rendered_value values. Choosing such a value will return its
associated real value (real_value) or the value inserted when you edit
a list entry. Note: The list of
'real_value':'rendered_value' pairs can be computed using
${xpath_eval()}.
Note: The
'default' parameter specifies the default-selected value and can
match either a key or a value.
|
|
Example:
|
|
| radio | Format: ${ask('message', radio, ('real_value1':'rendered_value1';...;'real_valueN':'rendered_valueN'), 'default')} |
| Description: Displays a dialog box that offers a series of radio
buttons. Each radio button displays a 'rendered_value and will return
an associated real_value. Note: The list of
'real_value':'rendered_value' pairs can be computed using
${xpath_eval()}.
Note: The
'default' parameter specifies the default-selected value and can
match either a key or a value.
|
|
Example:
|
|
| textarea | Format: ${ask('message', textarea, 'default')} |
| Description: The input is a text area that requires no special handling. | |
Example:
|
${ask('Bundle for keydefs', radio, (${xpath_eval(let $family := 'utah', $bundles := doc(environment-variable('HOME') || '/git/dita-author-tools/resource/properties/bundle-data.xml')/*/family[@name eq $family]/*, $pairs := $bundles ! concat('''',./@bundle-code, '''',':', '''',./@map-filename,'''') return string-join($pairs, ';'))}), @bundle-code)}