You can create your own code template. After you create
a template, it is shown in the list of templates.
To create a new code template:
- From the main menu, click .
- From the navigation tree, expand and click Templates.
- In the Preferences window, click New.
- In the New Template window, specify both a name and a description
identify the template. When you want to use the new template, you
will type all or the beginning of the name and then activate content
assist. For more information about naming considerations, see "Code
templates."
- In the Pattern field, type the template:
- Type any text 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 (}):
${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.
- To create the template, click OK.
- To save your changes, click Apply.
- To close the window, click OK.