模板文件codetemplates.xml和formatter.xml在附件中formater.zip
1.由菜单Window ->Preference打开Eclipse配置界面
2.设置代码模板
JAVA->Code Style -> Code template ->import 导入代码模板codetemplates.xml
点击edit 修改
3.设置formater
Java -> Code Style -> Formatter ->import 导入格式化模版formatter.xml