1.创建新类自动添加注释
windows-->preference
Java-->Code Style-->Code Templates
code-->new Java files
编辑如下:
${filecomment}
${package_declaration}
/**
* @author 作者 :
* @version 创建时间:${date} ${time}
* 类说明
*/
${typecomment}
${type_declaration}
2.自动排版
2.1 java按C++风格排版
1. 打开Eclipse 的 windows菜单 / Preferences
2. 选择Java / Code Style / Formatter
3. 点新建并命名一个风格
4.Braces 栏: 除最后项的所有项改为Next line ,然后Apply
5.Control Statement 栏: 前三项打勾,然后Apply, OK退出
2.2 XML排版风格
1. 打开Eclipse 的 windows菜单 / Preferences
2. 选择XML / XML Files/ Editor
3. 除了第二个都打上勾,然后Apply, OK退出