Sometimes I want annotations on fields be in a single line and sometimes in a line each. Is there any way to make Eclipse formatter just ignore these annotations and leave the lines breaks just as I did?
Go to Source | Format Document or press Ctrl+Shift+F.
Eclipse 3.6 allows you to turn off formatting by placing a special comment, like // @formatter:off ... // @formatter:on. The on/off features have to be turned "on" in Eclipse preferences: Java > Code Style > Formatter . Click on Edit , Off/On Tags , enable Enable Off/On tags .
Not quite sure what you mean, but you break up lines for field this way:
String text =
"cake" +
"more cake" +
"alot more cake";
This is also an option: You can go to Properties -> Java code style -> Formatter -> Edit: Then there should be some tags to on/off. Also include this line in your code:
/* @formatter:on */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With