eclipse设置

1. 全局编码格式为utf-8

转自:http://jingyan.baidu.com/article/851fbc37c09c2d3e1f15aba9.html  查看原网页,有图文对照

1. Window -> Preferences -> General -> Workspace -> Text file encoding,选择Other选项的UTF-8


2.Window -> Preferences -> General -> Content Types 选择Text,下边Default encoding写为:UTF-8,点Update按钮。展开Text,把"Java Properties File"、"JSP"的"ISO-8859-1"统统设置为UTF-8


3.Window -> Preferences -> Web -> JSP Files -> Encoding选择ISO 10646/Unicode(UTF-8),点Apply按钮




2. 设置注释模板

转自:http://swiftlet.net/archives/1199

设置注释模板的入口:Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置注释的元素。本文现就每一个元素逐一给大家介绍一下。
文件(Files)注释标签:

/**
* @Title: ${file_name}
* @Package ${package_name}
* @Description: ${todo}(用一句话描述该文件做什么)
* @author ${user}
* @date ${date}
* @version V1.0
*/

类型(Types)注释标签(类的注释):
/**
* @ClassName: ${type_name}
* @Description: ${todo}(这里用一句话描述这个类的作用)
* @author ${user}
* @date ${date}
*
* ${tags}
*/

字段(Fields)注释标签:
/**
* @Fields ${field} : ${todo}(用一句话描述这个变量表示什么)
*/

构造函数(Constructor)标签:
/**
* 创建一个新的实例 ${enclosing_type}.
*
* ${tags}
*/

方法(Methods)标签:
/**
* @Title: ${enclosing_method}
* @Description: ${todo}(这里用一句话描述这个方法的作用)
* @param ${tags}    参数
* @return ${return_type}    返回类型
* @throws
*/

覆盖方法(Overriding Methods)标签:
/* (非 Javadoc)
* <p>Title: ${enclosing_method}</p>
* <p>Description: </p>
* ${tags}
* ${see_to_overridden}
*/

代理方法(Delegate Methods)标签:
/**
* ${tags}
* ${see_to_target}
*/
getter方法标签:
/**
* @return ${bare_field_name}
*/

setter方法标签:
/**
* @param ${param} the ${bare_field_name} to set
*/









發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章