The OCLEditor Professional Edition > OCL Templates preference page allows to create new and edit existing templates. A template is a convenience for the programmer to quickly insert often reoccurring source code patterns.
The following buttons allow manipulation and configuration of templates:
|
Action |
Description |
|---|---|
|
New... |
Opens the Template dialog to create a new template. |
|
Edit... |
Opens the Template dialog to edit the currently selected template. |
|
Remove |
Removes all selected templates. |
|
Restore Removed |
Restores any preconfigured templates that have been removed. |
|
Revert to Default |
Restores any preconfigured templates to their default. This does not modify user-created templates. |
|
Import... |
Imports templates from the file system. |
|
Export... |
Exports all selected templates to the file system. |
|
Use code formatter |
If enabled, the template is formatted according to the code formatting rules specified in the Code Formatter preferences, prior to insertion. Otherwise, the template is inserted as is, but correctly indented. |
The following fields and buttons appear in the dialog:
| Option | Description |
|---|---|
| Name | The name of the template. |
| Context | The context determines where the template can be used and the set of available pre-defined template variables.
|
| Automatically insert | If selected, code assist will automatically insert the template if it is the only proposal available at the caret position. |
| Description | A description of the template, which is displayed to the user when choosing the template. |
| Pattern | The template pattern. |
| Insert Variables... | Displays a list of pre-defined context specific template variables. |
