To use templates:
Notes:
Templates can have variables, which are place-holders for the dynamic part of a template pattern, e.g. subject to change with every application of the particular template.
When a template is inserted in the Java editor and the template pattern contained a template variable, the editor enters the template edit mode.
The first variable is underlined and selected. The variable can be modified by typing in the editor. If the same variable existed multiple times in the template pattern, all instances of the same variable are updated instantaneously to save typing.
Pressing Tab navigates to the next unique template variable, Shift-Tab navigates to the previous unique template variable.
The template edit mode is left by either pressing Tab on the last template variable or pressing Esc or Enter.
Example:
void m(int [] foos){}
and position the caret
inside the method.
for
and press Ctrl+Space to open Code Assistfoos
) is automatically
detected.i
is now selected (your are in the template
edit mode) - you can type another name for it. Notice that the name is updated
instantaneously everywhere where the local variable is used.