Using Macros in Templates

You can also use macros in your templates to have various strings automatically generated when you create objects from template. Macros are called in templates in the form __MacroName__ (with two underscores before and two underscores after the macro name). The IDE includes several uneditable macros and one editable macro. You can also create your own macros.

The IDE has the following uneditable macros:

Many templates in the IDE use the __USER__ macro, which substitutes the user name in files created from.

To edit the __USER__ macro:

  1. Choose Tools and choose Options.
  2. Expand the Editing node, and select the Java Sources node.
  3. Select the Strings Table property, and click the ellipsis (...) button to open its custom property editor.
  4. Edit the value of USER and click OK.

To create a new macros for use in templates:

  1. Choose Tools and choose Options.
  2. Expand the Editing node, and select the Java Sources node.
  3. Select the Strings Table property, and click the ellipsis (...) button to open its custom property editor.
  4. Add macros in the form MacroName=Value and click OK.

    When you define the macro, do not place the underscore characters at the beginning and end of the macro name.

See also
Creating a Template
Modifying a Template
Creating a Template for a Group of Files

Legal Notices