Editor Options: Code Templates

Use this tab to add, delete, or modify code templates. Code Templates are abbreviations that you type into the code and that the editor expands into code blocks. The templates include placeholder values. After you expand a code template, you go through the expanded block and replace the placeholder values.

You can modify the following elements:

Element Description

Language

Select a language from the drop-down list to see the code templates available for that language.

Templates

The table displays the current code templates for the selected language. The fields in the table are read-only.

    Abbreviation

The abbreviation for the expanded code.

    Expanded Text

The code that the editor will generate when you type the abbreviation.

    Description

A description of the template. (Optional)

Expanded Text

This tab contains the expanded code. You can type in this text area to modifyan existing code template or when you create a new code template.

Description

This tab contains a description of the code template. You can type in this text area to modify or create a description for a code template.

Expand Template On

Select the key or key combination that is used to expand code template abbreviations. By default, press Tab to expand an abbreviation. You can change this to Shift, Shift-Space, or Enter.

On Template Expansion

Select the formatting task that the IDE performs when you expand a code template abbreviation. By default, the IDE reformats the code. The IDE instead can only reindent the code or do no formatting.


Related Topics

Developing Applications with NetBeans IDE,

Developing Applications with NetBeans IDE,

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0.