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