Eclipse Code Cleanup Code formatting code gaze

Source: Internet
Author: User

The code style consists of two aspects: Codes cleanup, code normalization. Code cleanup can be a test:

http://www.ibm.com/developerworks/cn/opensource/os-eclipse-clean/

http://jiajun.iteye.com/blog/287803

Code cleanup Process:

Go to Eclipse menu: Window > Preferences > Java > Code Style > Clean up, click Import above the interface, select the Eclipse installation in the popup box

Eclipse/cleanup-profile.xml under the path, click

Open, click Apply in the lower right corner to make it effective.

Code formatting process:

Go to Eclipse menu: Window > Preferences > Java > Code Style > Formatter, import eclipse/formatter-profile.xml using a method similar to the above, and

Make it effective.

Set the implementation time of the code formatting, generally for the time when you save the active format:

Go to Eclipse menu: Window > Preferences > Java > Editor > Save Actions, tick on perform the selected actions under Save for Mat

source code, and select Format all lines, tick on organize imports, click Apply in the lower right corner to make it effective.

Join in eclipse? Gaze

(1) Add to the method above? Gaze:

On the top line of the method,/**, then enter.

(2) in the file header join? Gaze:

Use shortcut keys to alt+shift+j. The gaze format can be changed by adding a window->preference, open the Parameters Settings panel via the menu, and select: Java-

Code Style, Code Templates, on the right side, select Comments, select the types item, and then choose "Edit" on the right to enter edit mode. Enter edit mode

You can define your own gaze after the formula. You can also insert some variables, such as year, date, and so on. Finally, make sure that the Code-and New Java files

There are: "${filecomment}".


If you do not find Cleanup-profile.xml and formatter-profile.xml, you can search the Internet.

A template for today's company: http://download.csdn.net/detail/qilixiang012/7246395

Code cleanup and format configuration file (Main): http://download.csdn.net/detail/qilixiang012/7728385

Eclipse Code Cleanup Code formatting code gaze

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.