Using the Project Template Editor

Editing Templates is done though the Templates view.

  1. From the menubar, select Window > Show View > Templates


  2. The Templates view opens.


  3. Right click on a template in the Java Project section and select Open.


  4. The Project Template editor opens.

By opening and exploring the default templates that come with Together, you'll get a better understanding of how easy it is to create your own project templates.

Overview

The first time you open the editor for a template, the Overview tab defaults. On this tab, the description is the text that appears in the description pane of the Apply Pattern... dialog when you select this template. The description text area supports basic html tags to format the text. The help context id field can be used to enter an id to link to a help page that may further describe the template:.

Variables

Variables can be used to specify text in the code that the template generates, or for use as names that appear on the various tabs. To view and edit variables, click the Variables tab:

There are default variables that come as standard that are not displayed on this tab but available to you:

Variable types are described in Template Variable Types

Units

Click the Units tab to create the individual classes that the package template should generate.

Use "Add," "Remove," and "Rename" to create the list of classes:

NB: Take care when using "Remove." You will not be prompted before deletion.

The area below the list is used to enter the syntax for each class, including any comments:

As you select the different classes in the list, the area displays the syntax for that class. You can also use conditional statements based upon the variables you create on the Variables tab.

Natures

Together projects can have one or more natures, for example, a Java Project has the Java nature. Using this tab a user can make sure a project is created with the correct natures after the template has been applied.

Classpath

To create the correct classpath for the project that the template will create, you can use this tab you can to add the relevant classpath entries.

You can use variables names from the Variables tab. You can also use Together variable names added via Preferences > Java > Classpath Variables.

Related Topic:

Project Template Editor