码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2016-05-09 15:46:06      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:

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即可。

如下图所示:

技术分享

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

标签:

原文地址:http://www.cnblogs.com/hangaozu/p/5474064.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!