Http://phl.iteye.com/blog/1028218
Because of Eclipse's defaultCodeStyle is not practical. This article provides some personalized settings.
The unified code style facilitates project management, establishes a good environment for the entire team, and reduces reading costs. All the strong team collaboration efforts are accumulated.
Taking eclipse3.6.2 _ javaee as an example, it is unclear whether other versions are compatible.
1. [Window]/[Preferences]/[Java]/[Code style]/[formatter]/[edit]
2. Panel [indentation]
Tab policy = spaces only
Indentation size = 4
Tab size = 4
This function only applies to space indentation and does not use table, which can remove TXT recognition problems on different platforms.
Select align fields in Columns
Its role is to define attributes in its class.
3. Panel [Line wrapping]
Maximum line width = 400
His role is not to allow the code to wrap automatically.
[Method declarations]/[parameters]
Line wrapping policy = wrap all elements, exception first element if not necessary
Select force split, even if line shorter than maxmum width
Indentation policy = indent on column
This function is used to set a line of parameters during method declaration, especially when there are more than a dozen parameters of a method in spring MVC.
4. Panel [comments]
Remove enable line comment formatting
The meaning is to remove the formatting of a single line comment.
5 if you want to directly import the template, see the latest version of the attachment.