While using the Code Editor, you can add your favorite code constructs to the Template Manager to create a library of the templates you use most often.
To add a Live Template using the Menu Commands
- While you are working in the Code Editor, choose FileNewOtherOther Files and then select the Live Template icon.
- Fill in the template name, description, author, and code language attributes. Then type in the code for your template between the <![CDATA[]]> tag and the </code> tag.
Note: The Name
and Language fields in the template are required.
- Choose the Save command from the File pull-down menu in the Code Editor (or type CTRL + S). Your new template now appears in the IDE tree of the Template Manager window. It is saved, by default, into the \5.0\Objrepos\code_templates\ directory.
To add a Live Template using the Template Manager window
- In the Code Editor, choose ViewTemplates.
- In the Template Manager window, click the New button. This will put an XML outline for a code template in the Code Editor main window. You can also select code in the editor before you click the New button.
- Fill in the template name, description, author, and code language attributes. Then type in the code for your template between the <![CDATA[]]> tag and the </code> tag.
Note: The Name
and Language fields in the template are required.
- Choose the Save command from the File pull-down menu in the Code Editor (or type CTRL + S). Your new template now appears in the IDE tree of the Template Manager window. It is saved, by default, in the \5.0\Objrepos\code_templates\ directory.