Eclipse code style settings

Source: Internet
Author: User

 

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.