Show TOC

Code TemplatesLocate this document in the navigation structure

Use

The new Front-End Editor has a functional shell for creating and applying code templates. The templates significantly reduce the amount of routine coding.

Features

The editor has a number of predefined code templates. They are suggested by code hints. Whenever you see the § symbol in a code hint, you can insert a predefined template by pressing Ctrl + Enter.

The code templates have built-in runtime tags for:

  • Cursor Position

  • Date / Time

  • Clipboard Contents

  • Surrounded Text

  • Document name

  • You can also define interactive tags like name of a class or name of a method, which you need to specify when you insert the template.

CODE TEMPLATES 2
Figure 1: Variables in Code Templates
Activities
  • Edit an existing template

    In the right-hand corner of the screen, choose Options ( ) Start of the navigation path Code Templates End of the navigation path. From the list of available templates, choose the one you want to modify. After you have applied your changes, choose Apply. You can insert any of the available predefined tags, your own interactive tags and type any code you like.

  • Create a new template

    In the right-hand corner of the screen, choose Options ( ) Start of the navigation path Code Templates Next navigation step Add.. End of the navigation path. Enter a shortcut name for the template (coincides with the description of the template). After you have applied your changes, choose Apply. You can insert any of the available predefined tags, your own interactive tags and type any code you like.

  • Extract template from a selected text

    In the source code, select the text you want to save as a template and in the context menu, choose Start of the navigation path Format Next navigation step Extract Template End of the navigation path.Enter a shortcut name for the template (coincides with the description of the template). After you have applied your changes, choose Apply.

  • Surround by template

    In the source code, select the text you want to surround by a template and in the context menu, choose Start of the navigation path Format Next navigation step Surround by template Next navigation step <Name of a suitable existing template> End of the navigation path.

More Information