Lets you control the behavior of the separator comments. When the sorting of declarations is enabled, separator comments may be inserted before every element section to make it easier to identify the different parts of a source file.
A separator comment usually starts with a leading //~
followed by the specified description text of a section and a certain number of
fill characters to take up the rest of the space. But the style of the comments
is fully configurable as well.
Example 2.728. Separator comment
//~ Methods ------------------------------------------------------------------
Controls when separator comments should be inserted.
Enables the insertion of separator comments between the different code sections of a compilation unit. You can control the appearance of the comments as described in the section called “Separator Comment Descriptions” and the section called “Separator Comment Style”.
Example 2.729. Separator comments
public class Foo { //~ Static fields/initializers --------------------------------------- static final String LABELED_BY_PROPERTY = "labeledBy"; //~ Instance fields -------------------------------------------------- private Icon defaultIcon = null; //~ Constructors ----------------------------------------------------- public Foo(String text, Icon icon) { ... } public Foo(String text) { ... } //~ Methods ---------------------------------------------------------- public Icon getDisabledIcon() { ... } public Icon getIcon() { ... } //~ Inner Classes ---------------------------------------------------- protected class FooContainer { ... } }
The option requires the “Sort declarations” option to be enabled in order to take effect
The insertion of separator comments for inner classes/interfaces may lead to confusion, therefore you can control it here separately.
Example 2.730. Separator comments
public class Foo { //~ Static fields/initializers ----------------------------------- static final String LABELED_BY_PROPERTY = "labeledBy"; //~ Instance fields ---------------------------------------------- private Icon defaultIcon = null; //~ Constructors ------------------------------------------------- public Foo(String text, Icon icon) { ... } public Foo(String text) { ... } //~ Methods ------------------------------------------------------ public Icon getDisabledIcon() { ... } public Icon getIcon() { ... } //~ Inner Classes ------------------------------------------------ protected class FooContainer { public Component getParent() { ... } //~ Methods -------------------------------------------------- public int getComponentCount() { ... } } }
The option requires the “Sort declarations” option to be enabled in order to take effect
When enabled, separator comments are inserted between method declarations.
Since 1.3
Example 2.731. Method comment separator
/** * Returns the value of the disabledIcon property if it’s been set * * @return The value of the disabledIcon property. */ public Icon getDisabledIcon() { ... } //~ ---------------------------------------------------------------- /** * Return the keycode that indicates a mnemonic key. * * @return int value for the mnemonic key */ public int getDisplayedMnemonic() { ... }
The option requires the “Sort declarations” option to be enabled in order to take effect
When enabled, separator comments are inserted between method declarations of inner classes.
Since 1.7
“Sort declarations” must be enabled in order to take effect
Example 2.732. Method comment separator of inner classes
public class Foo { ... static class Item { /** * Returns the value of the disabledIcon property if it’s been * set * * @return The value of the disabledIcon property. */ public Icon getDisabledIcon() { ... } //~ ////////////////////////////////////////////////////////// /** * Return the keycode that indicates a mnemonic key. * * @return int value for the mnemonic key */ public int getDisplayedMnemonic() { ... } } }