Customizing Code Templates for the Source Editor
Code templates assist you in writing code more quickly and efficiently
while you are in the source editor. You can edit the existing templates
or create your own.
This topic includes the following related procedures:
To view existing code templates:
-
From the main menu, choose Tools
Preferences, expand the Code Editor
node, and select Code Templates.
-
On the Code Templates page, scroll through the shortcuts, which
represent the letters you must type to evoke each template.
For more information while using the Code Templates page, press F1
or click Help.
-
Click on any shortcut to view the associated template code on the
Code tab. If there are any imports associated with this template, they
will be shown on the Imports tab.
To edit an existing code template:
-
From the main menu, choose Tools
Preferences, expand the Code Editor
node, and select Code Templates.
-
On the Code Templates page, make changes to the shortcut, the
description, the code (including the variables used in it), and the
imports, as required.
For more information while using the Code Templates page, press F1
or click Help.
-
When you are finished, click OK.
To define a new code template:
-
From the main menu, choose Tools
Preferences, expand the Code Editor
node, and select Code Templates.
-
On the Code Templates page, click Add
.
The cursor jumps to the bottom of the Shortcut
list and a new row is added.
-
Type in the name for the new shortcut and add a description in the
list next to it.
For more information while using the Code Templates page, press F1
or click Help.
-
Select the Code tab and enter the code for
this template. Note that cursor position is a part of the template,
representing the logical insertion point for new code to be entered
when the template is used.
-
Select the Imports tab and enter any
imports associated with this template.
-
Click OK.
Related topics
Customizing the
Source Editor Environment
Working with Keymaps in the IDE
Editing Source Files
About the Java Source Editor
About the XML Editor
Reference: JDeveloper Code Templates
Copyright © 1997, 2006, Oracle. All rights reserved.