Controls the handling of curly braces (the Java block delimiters).
Lets you define how the enclosing block delimiters - open and closing curly brace - are printed. You can either choose from a predefined set of common styles or build one on your own. The brace style can either be configured individually for each block construct (details view) or one global style used (global view).
Defines wether one brace style should be used for all block constructs. When disabled, a combo box appears that lets you define the desired brace style for the different block constructs individually.
Since 1.6
Lets you choose the block construct whose brace style should be configured. Select an item to display the available brace style options for the chosen block construct.
This option is only available when the global brace style check box is disabled.
Since 1.6
Lets you choose a pre-configured brace style. Choosing a style will adjust all individual brace style options accordingly.
The available styles are:
Lets you synchronize the brace style of the currently selected block construct with the brace style of another one. Select an item to have the brace style options updated accordingly.
This option is only available when the global brace style check box is disabled.
Since 1.6
Lets you configure the line wrapping options.
When enabled, a line break gets printed before the left curly brace.
When enabled, a line break gets printed after the left curly brace (when possible).
It is common in the Java developer community to have the opening brace at the end of the line of the keyword for all types of blocks (Sun brace style). One may find the C++ convention of treating class/interface and method/constructor blocks different from other blocks useful. With this option you can achieve exactly that: if enabled, class/interface and method/constructor blocks are then always printed in C brace style (line break before left brace).
Example 2.39. Sun brace style
class VolkswagenBeetle extends AbstractAutomobile { public void tootHorn() { if (isNull) { throwConstraintViolated(); } else { updateValue(); } } }
Example 2.40. Sun brace style, but class/method block treat different
class VolkswagenBeetle extends AbstractAutomobile { public void tootHorn() { if (isNull) { throwConstraintViolated(); } else { updateValue(); } } }
This option is only available when the global brace style check box is enabled.
Enabling this option forces a line break before the opening brace for class/interface or method/constructor blocks (C style), if either the parameter list spawns several lines and a throws clause follows, or one of the possible clauses (extends, implements, throws) was wrapped.
This option is only available when the global brace style check box is enabled.
Using the Sun brace style can make it hard to identify the start of the block body. The recommended workaround is to increase indentation for the expression statements during line wrap (see "Block continuation indentation").
But it may be easier to change the style of the block brace for such cases. Enabling this option does exactly that: It forces a line break before the opening brace for block statements (if/for/while etc.), if the statement expression could not be printed in just one line.
Since 1.7
Example 2.41. Wrapped block statement (Sun brace style)
if (((x > 0) && (y > 0)) || ((x < 0) && (y < 0))
&& ((x > y) || (x < -y))) {
reverseCourse();
}
Example 2.42. Wrapped block statement - left curly brace treated different
if (((x > 0) && (y > 0)) || ((x < 0) && (y < 0))
&& ((x > y) || (x < -y)))
{
reverseCourse();
}
This option is only available when the global brace style check box is enabled or the style for Statements is currently configured.
Lets you adjust the indentation white space for curly braces individually.
Defines the amount of blank space that should be printed before the left curly brace.
Defines the amount of blank space that should be printed before the right curly brace.
Defines the amount of blank space that should be printed after the right curly brace.