You can create your own code template. After the template is created
it is shown in the list of templates.
To create a new code template, follow these steps:
- From the main menu, click .
- From the navigation tree, expand and then click Templates.
- From the Preferences window, click New.
- In the New Template window, specify both a name and a description
to uniquely identify the template. When you want to use the new template,
you will type all or the beginning of the name and then activate code
assist. For more information on naming considerations, see Code templates.
- 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.
- Click OK to create the template.
- To save your changes, click Apply.
- Click OK to close the window.