Lets you specify extra indentation for consecutive lines of certain elements.
With standard indentation enabled, this option causes an extra increase of the indentation level upon wrapping of method and constructor parameters. With endline indentation this option is meaningless.
Example 2.615. Wrapped method parameters
public void aMethod(int param 1, int param2, | int param3) { | int a = param1 + param2 + param3; | } |
Example 2.616. Wrapped method parameters with continuation indentation
public void aMethod(int param 1, int param2, | int param3) { | int a = param1 + param2 + param3; | } |
The Sun brace style could make seeing the statement body difficult. To work around this problem, you may want to use continuation indentation in case you like this brace style. This setting applies for if, for, while and do-while blocks.
Example 2.617. Non-continuation indentation
if ((condition1 && condition2) || (condition3 && condition4) || !(condition5 && condition6)) { // BAD WRAPS doSomethingAboutIt(); // MAKE THIS LINE EASY TO MISS }
Example 2.618. Continuation indentation
if ((condition1 && condition2)
|| (condition3 && condition4)
|| !(condition5 && condition6)) {
doSomethingAboutIt();
}
Refer to the section called "Layout" for the available brace style options.
If enabled, indentation will be increased before an operand will be printed.
Example 2.619. Ternary expression (endline indented)
String comma = spaceAfterComma
--->? COMMA_SPACE
--->: COMMA;
Lets you increase the indentation level after return statements. This is only meaningful when a statement cannot be printed in one line.
Since 1.6
Example 2.620. return statement
return auswahlkriteriumComboBox.getUnselectedValueContent() |
.equals(auswahlkriteriumComboBox.getSelectedItem()); |
Example 2.621. return statement with continuation indentation
return auswahlkriteriumComboBox.getUnselectedValueContent() |
.equals(auswahlkriteriumComboBox.getSelectedItem()); |
As you can see from the above examples, without continuation indentation it might happen that wrapped lines are printed at the same indentation level as the return statement. It really depends where the line wrapping takes place. The two following examples indent both no matter what setting (though different, of course).