当前位置: 移动技术网 > IT编程>开发语言>Java > 设置Myeclipse中的代码格式化、注释模板及保存时自动格式化

设置Myeclipse中的代码格式化、注释模板及保存时自动格式化

2019年07月22日  | 移动技术网IT编程  | 我要评论

1:设置注释的模板:

下载此模板:codetemplates.xml
搜索dangzhang,将其改为你自己的姓名,保存
打开eclipse/myeclipse
选择 window-->preferences-->java-->code-->code templates 右边点import 选择你写好的模板.xml文件导入进去即可

2:设置格式化的模板:

格式化模板:eclipse-formatter.xml
格式化模版方法同上,只是不是选择code templates ,而是选择formatter。

3:保存时自动格式化代码:

打开eclipse/myeclipse
选择 window-->preferences-->java-->editor-->save actions
右边选中:perform the selected actions on save
format source code
format all lines
organize imports
保存后重启myeclipse即可。
如下图所示:

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网