一. 智能提示
二. Eclipse包摺疊視圖
三、修改默認編碼爲UTF-8
四、代碼塊摺疊 com.cb.eclipse.folding(類似Visual Studio的#region ...#endregion )
<span style="font-size:18px;"> Ctrl+Shift+Numpad_Divede(小鍵盤的/號) Ctrl+Shift+Numpad_Multiply(小鍵盤的*號)</span>
3. 啓動eclipse後,進入 window->preference 菜單選項,在配置窗口中選擇 java->editor,select folding to user 中選擇"Coffee Bytes Java Folding",保存後重啓 eclipse 。
4. 重啓之後再次進入步驟2,勾選最後一個 User Defined Regions, 保存後即可。(當然可以在User Defined Regions自定義摺疊方式)
五、get/set方法自動加上字段註釋
參考:http://blog.csdn.net/manageer/article/details/9028891
1. 找到Eclipse目錄下搜索找到org.eclipse.jdt.ui_*.jar(*是版本號),進行備份
2. 將jar文件改成.rar格式並使用壓縮軟件打開。
3. 找到\org\eclipse\jdt\internal\corext\codemanipulation這個目錄下的GetterSetterUtil.class這個文件。反編譯修改getSetterStub 和 getGetterStub 方法,修改如下,或者直接使用(此鏈接文件)替換(記得要備份喔)
if (addComments) {
//field.getCompilationUnit() 得到當前類文件內容,就是要get,set的東西
//parentType.getTypeQualifiedName('.') 得到類名
//getterName 拼出get的方法名
//field.getElementName() 得到字段名
//typeName 類型
String comment= CodeGeneration.getGetterComment(
field.getCompilationUnit(),
parentType.getTypeQualifiedName('.'),
getterName,
field.getElementName(),
typeName,
accessorName,
lineDelim);
ISourceRange sr = field.getJavadocRange();
if( null != sr ) {
String filedComment = field.getSource();
filedComment = filedComment.substring(0, sr.getLength());
filedComment = filedComment.replaceAll("[\n,\r,*,/, ,\t]", "");
comment = comment.replaceFirst(field.getElementName(), filedComment);
int i = comment.lastIndexOf(field.getElementName());
int j = getCount(comment, field.getElementName());
if (i != -1 && j >= 2) {
comment = comment.substring(0, i) + filedComment + comment.substring(i + field.getElementName().length());
}
}
if (comment != null) {
buf.append(comment);
buf.append(lineDelim);
}
}
4. 開啓開發工具找到Window->Preferences->Java->CodeStyle->Code Templates->Comments->Getters/Setters
getters:
- /**
- * 獲取${bare_field_name}
- * @return ${bare_field_name} ${bare_field_name}
- */
- /**
- * 設置${bare_field_name}
- * @param ${bare_field_name} ${bare_field_name}
- */
注意:生成Get/Set方法時勾選上Generate method comments
六、其它設置
- 設置字體大小:Window->preferences->General——Appearance——Colors and Fonts——Basic——Text Font——Edit
- 顯示行號:Window->preferences->General——Editors——Text Editors——Show line numbers
- 保存的時候,自動格式化代碼:Window->preferences->java——>editor——>Save Actions
- 設置自定義代碼代碼風格:窗口→首選項→Java→代碼樣式→格式化程序→新建
- 設置註釋模板:Window->preferences->java->code style ->code templates ->Comments ->typese->edit->
/**
* @author 付亮
* @date ${date}${time}
* ${tags}
*/
或者在:在eclipse的安裝路徑下,打開eclipse.ini的配置文件
在-vmargs下加入:
-Duser.name=你的名字