Formatting Code
When you type a line of code in the Source Editor and press Enter, the
next line is automatically indented according to the hierarchy in the code.
To modify indentation:
- Press Ctrl-T to increase line or block indentation.
- Press Ctrl-D to decrease line or block indentation.
In both cases, if nothing is selected, the current line is shifted one tab
stop. If a block of text is selected, all those lines are shifted.
To automatically format code:
- Select the text you want to format. Do not select any text if you want
to format the entire file.
- Press Ctrl-Shift-F or right-click in the Source Editor and choose Reformat
Code from the contextual menu.
 |
You can set properties to specify whether a space is added before an opening
parenthesis and whether an opening curly brace is placed on a new line whenever
text is generated or reformatted by the IDE. You can also configure the
number of spaces you want in a tab stop. Set these options
by choosing Tools Options and then
selecting the Java Editor subnode of Editor Settings.
|
See also |
|
Configuring the Source Editor
Setting Keyboard Shortcuts
Java Editor Properties
|
Legal Notices