Setting preferences for templates
Do as follows to add, remove, or customize the templates that are displayed when you request content assist in the EGL editor:
- Click Window > Preferences.
- When a list of preferences is displayed, expand EGL and Editor, then click Templates. A list of templates is displayed.
Note: As in other applications on Windows 2000/NT/XP, you can click an entry to select it; can use Ctrl-click to select or unselect an entry without affecting other selections; and can use Shift-click to select a set of entries that are contiguous to the entry you last clicked.
- To make a template available in the EGL editor, select the check box to the left of a template name. To make all the listed templates available, click Enable All. Similarly, to make a template unavailable, clear the related check box; and to make all the listed templates unavailable, click Disable All.
- To create a new template, do as follows--
- Click New
- When the New Template dialog is displayed, specify both a name and a description because a template is guaranteed to be displayed in a content-assist list only if the combination of name and description are unique across all templates.
Note: If the first word used in the template is an EGL keyword (such as Function), the template is available when you request content assist in the EGL editor, but only when the on-screen cursor is at a place where the word is valid. Similarly, if you type a prefix, then request content assist, all templates beginning with that prefix are available provided the on-screen cursor is in a position where that template is syntactically allowed. For example, type "fun" to request function templates. If you do not type either a prefix or the full first word, you will not see any templates when you request content assist.
- In the Pattern field, type the template itself:
- Type any text that you wish to display
- To place a preexisting variable at the on-screen cursor position, click Insert Variable, then double-click a variable. When you insert the template in the EGL editor, each of those variables resolves to the appropriate value.
- To create a custom variable, type a dollar sign ($) followed by a left brace ({), a string, and a right brace (}), as in this example:
${variable}You may find it easier to insert a preexisting variable and change the name for your own use.
When you insert a custom template in the EGL editor, each variable is underlined to indicate that a value is required.
- To complete the task, click OK and, at the templates screen, click Apply.
- To review an existing template, click on the listed entry and review the Preview box.
- To edit an existing template, click on the listed entry, then click Edit. Interact with the Edit Template dialog as you did with the New Template dialog.
- To remove an existing template, click on the listed entry, then click Remove. To remove multiple templates, use the Windows 2000/NT/XP convention for selecting multiple list entries, then click Remove.
- To import a template from an XML file, click Import at the right of the template list and follow the browse mechanism to specify the location of the file.
- To export a template to an XML file, click Export at the right of the template list and follow the browse mechanism to specify the location of the new file. To export multiple templates, use the Windows 2000/NT/XP mechanism for selecting multiple list entries, then click Export.
- To export all the listed templates to an XML file, click Export All and follow the browse mechanism to specify the location of the file.
- To save your changes, click Apply. To return to the template list that was in effect at installation time, click Restore Defaults.
Related reference
Content assist