Templates view

A template is a section of code that is frequently used. You want to insert it with a few keystrokes.

The Templates view allows you to create your own, to edit, or add an existing template for the currently active editor.

To add the Templates view to the current perspective, click command link Window > Show View > Other... > General > Templates.

Note that the content of this view is editor-specific. So, templates are not available for all editors.

Use

In the source code editors, templates can be added using content assist (Ctrl+Space) or by selection from the Templates view.

To create, edit, delete, import, and export templates, you can also use the Templates preference page.

Name

This column lists the available templates ascending in accordance to its name.

Description

This column provides further information about the usage and content of the available templates.

Preview

The preview displays the formatted source code of the template. This enables you to check if the template meets your requirements before adding it.

Toolbar

The toolbar in the Templates view contains the following functionalities:

Insert into Editor

Adds the template to the current cursor position in the active editor

Create a New Template

Opens the New Template dialog to determine a new template

Edit the Template

Opens the Edit Template dialog to rework an existing template

Remove the Template (Delete)

Deletes a template

Filter Templates by Current Caret Position

Hides or displays the templates that can be used or not at the current cursor position

Collapse All

Collapses the structure of available templates

Preferences...

Opens the Templates preference page