Options Window: Editor
See Also
You use this panel to adjust the properties that control the look and behavior of the Source Editor.
You can modify general editor properties and properties for specific types of editors (such as the Java editor and the XML editor).
You can access this panel by choosing Tools > Options from the main menu, and then clicking Editor in the left pane of the Options window.
The Editor panel contains the following tabs for customizing editor behaviour:
- General. This tab enables you to customize global code folding and code completion settings.
- Indentation. This tab enables you to customize global settings for text formatting, including settings
for tabs, spaces, and new lines.
- Code Templates. This tab enables you to customize the abbreviations for terms that you want the editor to expand automatically.
- Macros. This tab enables you to customize Source Editor macros.
General tab
This tab enables you to specify the following general editor settings:
- Code Folding. If selected, you have the option of collapsing the display of code blocks.
You can select which types of code blocks are collapsed by default.
Code folding is applied only to editor types that support code folding, such as the Java editor.
- Code Completion. As you are typing in the Source Editor, you can use the IDE's code completion feature to find code snippets and have them filled in for you automatically.
You can set the following code completion properties:
- Auto Popup Completion Window. When selected, enables the editor to display a code completion box with
options for how to complete an expression.
This property applies only to editor types that support code completion, such as Java, HTML, and JSP.
See Using Code Completion for details.
- Insert Single Proposals Automatically. When selected, the code completion box does not appear when the IDE is aware of
only one possible completion for the expression. The expression is completed automatically.
- Case Sensitive Code Completion. If selected, the code completion box only displays results that match the case of the expression
that you are typing.
- Show Deprecated Members in Code Completion. If selected, any depecrated class elements that are available are shown
in the completion box. Deprecated members are struck through with a line to indicate that they are deprecated.
- Insert Closing Brackets Automatically. When selected, the Source Editor generates the closing parenthesis, bracket,
brace, or quotation mark after you type the first one.
Indentation tab
This tab enables you to specify the following Java source code formatting settings:
- Statement Continuation Indent. Specifies the shift (in spaces) for the second and subsequent lines in a multi-line statement.
- Number of Spaces per Indent. Specifies the number of spaces represented by one indentation level.
- Expand Tabs to Spaces. When selected, inserts spaces when the Tab key is typed.
When unselected, typing the Tab key inserts the tab character (\t) into the file if
possible.
- Add Leading Star in Comment. When selected, automatically puts an asterisk (*) at the start of any line inside a block comment of a Java file.
- Add Newline Before Brace. When selected, automatically puts curly braces on the following line in generated Java code.
- Add Space Before Parenthesis. When selected, adds a space before the opening parenthesis in generated Java code.
The Preview pane displays how the applied changes will appear in the Source Editor.
Code Templates tab
Use this tab to modify the abbreviations for terms that you want the editor to expand automatically.
Select a language from the drop-down list to see the abbreviations available.
For each language you can do the following:
- Select an abbreviation from the list and type in the Abbreviation or Expanded Text field to modify the abbreviation.
- Select an abbreviation from the list and click Remove to remove the abbreviation.
- Click New and type the abbreviation and description in the respective fields.
You can use the Expand Template On drop-down list to change the
key or key combination that is used to expand the abbreviations.
By default, abbreviations are expanded when you press Space.
The Expand Template On drop-down list also contains the options of Shift-Space, Enter, and Tab.
Macros tab
Use this tab to edit, add, and remove Source Editor macros.
The macro names and shortcuts are listed in the upper pane.
The Macro Code editor in the lower pane displays the macro code and enables you to edit the code directly.
- To modify the macro code, select a macro from the list and edit the code in the Macro Code editor.
- To set a keyboard shortcut for a macro, select a macro from the list, click the Set Shortcut button and enter the shortcut in the dialog box.
- To create a new macro, click the New button, enter the name for the new macro, then select the new macro in the list and enter the code in the Macro Code editor.
- To remove a macro, select a macro from the list and click the Remove button.
- It is generally easier to add a new macro by recording it than by adding one manually in the Macro Code editor. See Recording a Macro for details.
- See Also
- Configuring the Source Editor
- Folding Blocks of Code in Java Files
- Folding Blocks of Code in JSP or HTML Files
- Using Code Completion
- Using the Options Window
Legal Notices