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
*/









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