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

1:设置注释的模板:web

下载此模板:  codetemplates.xmleclipse

搜索Dangzhang,将其改成你本身的姓名,保存code

打开eclipse/myeclipse
选择 window-->Preferences-->JAVA-->Code-->Code Templates 右边点Import 选择你写好的模板.xml文件导入进去便可orm

2:设置格式化的模板:xml

格式化模板:eclipse-formatter.xmlblog

格式化模版方法同上,只是否是选择Code Templates ,而是选择Formatter。ip

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

打开eclipse/myeclipse
选择 window-->Preferences-->JAVA-->Editor-->Save Actions 右边选中:it

Perform the selected actions on saveio

Format source code

Format all lines

Organize imports

保存后重启Myeclipse便可。

以下图所示:

相关文章
相关标签/搜索