Code templates are snippets of frequently used code elements that you can insert into your code to save repetitive typing. You can use code templates in the editor to speed up the coding process.
To use a code template in your code, select one of these methods:
classp
, in your code where you want the code to appear and press Ctrl+J. See Tools|Editor Options|Templates for the template names.
JBuilder's pre-defined code templates are formatted according to your project preferences. These options are set in the following locations:
Embed a newline character, '\n', within the string to indicate a new line. If you want the cursor to be on a new line after the last line of the expanded code, you must explicitly enter the newline character at the end of the template.
Use the pipe character, '|', to denote the caret position after the template is expanded.
In the following sample code template, the cursor will position to one blank space after the if keyword when the template is expanded:
if (|) { } else { }
Code templates are editable in JBuilder Professional and Enterprise.
Displays the Add Code Template dialog box where you enter the new code template name and description.
Code templates are editable in JBuilder Professional and Enterprise.
Displays the Edit Code Template dialog box where you edit the name and description of the selected template.
Code templates are editable in JBuilder Professional and Enterprise.
Deletes the selected template.