Setting EGL template preferences

You can enable, disable, create, edit, export, import, and remove code templates, and you can restore default code templates.

You can set template preferences in the following ways:

To set EGL template preferences, do as follows:

  1. From the main menu, click Window > Preferences. The Preferences window is displayed.
  2. From the navigation tree, expand EGL > Editor and then click Templates. The Templates pane containing a list of templates is displayed.
  3. You can perform the following tasks:
    Task Steps
    Enable code templates in the EGL editor In the Templates pane, select the check box to the left of a template name that you want to be available in the EGL editor.
    Disable code templates in the EGL editor In the Templates pane, clear the check box to the left of the template names that you do not want to show in the EGL editor.
    Create a new code template
    1. In the Templates pane, click New. A New Template window is displayed.
    2. In the New Template pane, specify both a name and a description to uniquely identify the template. When you want to use the new template, type all or the beginning of the name and then activate code assist.
    3. In the Pattern field, type the template itself:
      • Type any text that you want to display.
      • To place an existing variable at the current 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 might find it easier to insert an existing variable and change the name for your own use.

        When you insert a custom template in the EGL editor, each variable is highlighted to indicate that a value is required.

      • You can select an area of functionality for the template from the Context list, but user-defined templates are not filtered by capability like the default templates are. For user-defined templates, this value is for informational purposes only.
    4. Click OK to create the template.
    Edit an existing code template
    1. Select the desired template from the table and click Edit. An Edit Template window is displayed.
    2. Change the desired fields in the Edit Template window. When you are finished, click OK.
    Revert to the original template Select the desired template from the table and then click Revert to Default.
    Export code templates
    1. Select the desired templates from the table and click Export. An Export Templates window 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 deselect 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.
    2. In the Export Templates window, select the location to save the template file. You can browse the various locations to locate the place that you want to save the templates.
    3. Click Save to save the templates in the specified location.
    Import code templates
    1. Click Import. An Import Templates window is displayed.
    2. Select the location of the template file to be imported in the Import Templates window. You can browse the various locations to locate the template file that you want to import.
    3. Select the template file to be imported and click Open. The templates are added to the existing templates.
    Remove an existing code template In the table, select the templates that you want to remove, and click Remove.
    Restore the default code templates To return to the template list that was in effect at installation time, click Restore Defaults.
  4. To save the changes and remain in the Preferences window, click Apply. To save the changes and exit the window, click OK. To cancel the changes and exit the window, click Cancel.