...
- Select Window | Preferences. Choose Java | Code Formatter. Use the following options in the "New Lines" tab. (Options which aren't listed are up to you to decide.)
- Insert a new line before an opening brace (selected)
- Insert new lines in control statements (selected)
- Insert new line between 'else if' (deselected)
- Insert a new line inside an empty block (selected)
- In the "Line Splitting" tab, "Maximum line length" should be set to 80.
- In the "Style" tab, use the following options:
- Insert space after a cast (selected)
- Insert tabs for indentation, not spaces (deselected)
- Number of spaces representing an indentation level: 4
- In Java | Code Generation, use patterns similar to the following in the "Code and Comments" section: ;Comments | Types
Notes: (sb) Id: produces rather a long string, but it does include the date, which can be useful. I suggest using Date: as well as Revision:indent {noformat} /** {{{ * @author Your Name (include a mailto link if you wish) * @version $$Revision: $$ (some developers prefer $$Id: $$. That's okay too.) */ {noformat}
There are quite a few source files which use the @created "tag". However, there is no such tag, so javadoc generates warning messages.
Probably best to remove these entirely; the @since tag is a lot more useful. }}}
;Code | New Java filesindent \\ Insert the Apache license here. You can find the license at \[http://www.apache.org/LICENSE\]. Replace the year with $\{year\}, and Eclipse will use the current year automatically. \\
- In Java | Editor, use the following settings:
- Print margin column: 80
- Show print margin (selected) (This way you can see where 80 columns is at when writing code and comments.)
...