`
wwty
  • 浏览: 536965 次
  • 性别: Icon_minigender_1
  • 来自: 北京-郑州
社区版块
存档分类
最新评论

eclipse使用之formater和templates

阅读更多

formatter设定你偏好的代码格式

formatter位于java--->code style--->formatter 新建你喜好的格式,然后应用这个格式

试着在Perferences里搜索了一下commnet,找到了一个Formatter的配置项,

Java->Code Style->Formatter 点击Edit 后在Tab上选择Comments,将General settings中的"Enable comment formatting"前面的勾去掉就可以了.

 

templates设定快捷键代表的代码 templates位于java--->editor--->templates

例如:我在写代码之前想要加上如下内容:

/*

*<li> __date__=2009-8-19 </li>

* <li>__author__="wwty" </li>

* <li>__licence__="2009 by wwty"</li>

* <li>__version__="JDK5.0"</li>

*/

 

那么就可以再templates中new一个模板出来,我用jv代表上面代码,当我收入jv后,alt+/即可出现上面的模板。

分享到:
评论
1 楼 glamey 2010-08-28  
这样也挺好的。
其实咱们用到的项目代码注释两种。

一种是方法注释,一种的工程注释。

第一种--直接在java-code style-code template中的comment-type就可以搞定。
主要显示在,类头上边和每个方法上边。

第二种是显示在类的最上边,一般就是介绍工程描述之类的。

相关推荐

Global site tag (gtag.js) - Google Analytics