設置Myeclipse中的代碼格式化、注釋模板及保存時自動格式化


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

如下圖所示:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM