IntelliJ IDEA 13.1.0 Web Help

After a template is expanded, its variables are presented in the editor as input fields. The values of these fields can be either filled in by the user or calculated by IntelliJ IDEA.

To have it done automatically, for each variable you need to specify the following:

  • Expression to be calculated in association with the variable.
  • Default value to be entered in the input field if the calculation fails.

The order in which IntelliJ IDEA will process input fields after the template expansion, is determined by the order of variables in the list.

To configure variables used in a template
  1. Open the template settings, and in the Template Text area click the Edit Variables button.


    The Edit Variables button is enabled only if the template body contains at least one user-defined variable, that is, a variable different from $END$ or $SELECTION$.

    The Edit Template Variables dialog box opens, where you can define how the variables will be processed when the template is used.

  2. In the Name text box, specify the variable name to be used in the template body.
  3. In the Expression drop-down list, specify the expression to be calculated by IntelliJ IDEA when the template is expanded. Do one of the following:
    • Type a string constant in double quotes.
    • Type a predefined function with possible arguments or select one from the drop-down list.


      An argument of a function can be either a line constant or another predefined function.

  4. To enable IntelliJ IDEA to proceed with the next input field, if an input field associated with the current variable is already defined, select the Skip if defined check box.
  5. To arrange variables in the order you want IntelliJ IDEA to switch between associated input fields, use the Move Up and Move Down buttons.

See Also




Web Resources: