Java Formatting

This page describes the options in both Options: Editor: Formatting and Project Properties: Formatting if you select the Java language. Options: Editor: Formatting sets global options whereas Project Properties: Formatting sets project-specific options.

The Preview Window

The Preview window contains sample code that reflects changes you make in Formatting.

Categories

Tabs and Indents

Alignment

Align the selected elements when you place line breaks before them.

Braces

Wrapping

In this panel set the rules for the IDE to wrap lines automatically. The panel lists the possible locations before which the IDE wraps lines. For each location you can have the IDE never wrap lines, always wrap lines, or wrap lines if the statement is long.

Blank Lines

Improves readability by setting off sections of code that are logically related according to the specified options. Select the number of blank lines to place in the listed positions. For example, "After Field: 1" places 1 blank line after every field.

Spaces

In this panel, set where the IDE automatically puts whitespaces. Due to the large number of possible places to put whitespaces, the places to put whitespaces are displayed in a tree of categories. Expand a tree node to see the places under a category, or collapse a node to hide the places under a category. The categories are:

Comments

Enable Comments Formatting: Unselect to disable comments formatting. Selecting Enable Comments Formatting enables the following fields:

Imports


Legal Notices