Oracle Help for the WebContentsIndexSearchGlossaryView Topic


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:

  1. From the main menu, choose Tools then choose Preferences, expand the Code Editor node, and select Code Templates.
  2. 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.

  3. 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:

  1. From the main menu, choose Tools then choose Preferences, expand the Code Editor node, and select Code Templates.
  2. 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.

  3. When you are finished, click OK.

To define a new code template:

  1. From the main menu, choose Tools then choose Preferences, expand the Code Editor node, and select Code Templates.
  2. On the Code Templates page, click Add .

    The cursor jumps to the bottom of the Shortcut list and a new row is added.

  3. 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.

  4. 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.
  5. Select the Imports tab and enter any imports associated with this template.
  6. Click OK.

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