鍘熷湴鍧�锛歨ttps://blog.csdn.net/qq_39135287/article/details/82080373
1銆佹兂瑕侀厤缃瓻clipse鐨勭幆澧冿紝灏辫鍏堜笅杞紼clipse锛屽苟瀹夎瀹冿紝涓嶄細涓嬭浇瀹夎鐨勫皬浼欎即鍙互鐐瑰嚮涓嬮潰缁欑殑閾炬帴锛岄噷闈㈡湁鎴戝啓鐨勮缁嗙殑鏁欑▼锛岃繖閲屽氨涓嶉噸澶嶄簡
Eclipse涓嬭浇涓庡畨瑁咃細https://blog.csdn.net/qq_39135287/article/details/82108080
聽2銆佹帴涓嬫潵鎴戜滑閲嶇偣璁蹭竴涓婨clipse鐨勭幆澧冮厤缃�
聽 聽 聽 2.1銆佷慨鏀笶clipse榛樿鐨勫伐浣滅┖闂寸紪鐮侀泦锛岄粯璁ょ紪鐮侀泦涓篏BK锛屼慨鏀规垚UTF-8
聽 聽 聽 聽 聽 聽涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Workspace锛屾壘鍒扮浜屼釜Workspace锛屼慨鏀圭紪鐮侀泦涓� UTF-8,鏈�鍚庣偣鍑籄pply and Close 鎸夐挳銆傛搷浣滃涓嬪浘锛�
聽聽 2.2銆佷慨鏀笶clipse鐨勮祫婧愭枃浠剁紪鐮侀泦锛屼慨鏀规垚UTF-8聽 聽
聽 聽 聽 聽聽涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Content Types锛屾壘鍒癎eneral 鈫� 聽Content Types锛屽苟鐐瑰嚮鎵撳紑Content Types锛氫腑鐨凾ext
聽 聽 聽 聽浜屻�佹壘鍒癟ext涓嬬殑Java Properties File銆丣ava Source File 鍜� XML锛屽湪涓嬮潰鐨凞efault encoding杈撳叆妗嗕腑杈撳叆UTF-8锛屽苟鐐瑰嚮Apply and Close 鎸夐挳
聽 聽聽 2.3銆佽缃� ctrl + s 淇濆瓨鏃讹紝鑷姩鏍煎紡鍖栨墍鏈夎
聽 聽 聽 聽聽涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Save Actions锛屾壘鍒癑ava 鈫� Editor 鈫� Save Actions锛屾妸鍓嶄笁涓�夐」閮藉嬀閫変笂锛屾渶鍚庣偣鍑籄pply and Close 鎸夐挳銆傛搷浣滃涓嬪浘锛�
聽 聽2.4銆佽缃唴瀹硅嚜鍔ㄦ彁绀猴紝Eclipse榛樿 鎸変笅鐐癸紙鍗� .锛夌殑鏃跺�欙紝鎵嶄細鍑虹幇鍐呭鑷姩鎻愮ず锛岀幇鍦ㄨ缃櫎浜嗘寜涓嬬偣涔嬪锛屼换浣曚竴涓瓧姣嶇殑澶у皬鍐欓兘浼氭湁鍐呭鑷姩鎻愮ず
聽 聽聽涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Content Assist锛屾壘鍒癑ava 鈫� Editor 鈫� Content Assist锛屽湪Auto activation triggers for java瀵瑰簲鐨勮緭鍏ユ涓緭鍏ヂ�.qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM锛屾渶鍚庣偣鍑籄pply and Close 鎸夐挳銆傛搷浣滃涓嬪浘锛�
聽 聽2.5銆佷慨鏀筳sp榛樿鐨勭紪鐮侀泦锛岄粯璁ょ紪鐮侀泦涓篒SO Latin-1 锛屼慨鏀规垚ISO 10646/Unicode(UTF-8)
聽 聽聽涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆JSP Files锛屾壘鍒癢eb聽鈫� JSP Files锛屽湪Encoding涓嬫媺閫夋嫨妗嗕腑閫夋嫨 ISO 10646/Unicode(UTF-8)锛屾渶鍚庣偣鍑籄pply and Close 鎸夐挳銆傛搷浣滃涓嬪浘锛�
聽 2.6銆佷慨鏀笶clipse榛樿鐨勬祻瑙堝櫒锛寃eb绋嬪簭杩愯榛樿浣跨敤Eclipse鑷甫鐨勬祻瑙堝櫒锛屼慨鏀规垚浣跨敤澶栭儴娴忚鍣紝渚嬪锛氱伀鐙愩�佽胺姝�
聽 聽聽涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Web Browser锛屾壘鍒癎eneral聽鈫� Web Browser锛岄粯璁ら�変腑鐨勬槸Use internal web browser锛屾垜浠慨鏀归�夋嫨Use external web browser,聽 鍦‥xternal web browsers涓嬀閫変綘鍠滄鐨勬祻瑙堝櫒锛屾垜杩欓噷鍕鹃�夌殑鏄疌hrome锛屾渶鍚庣偣鍑籄pply and Close 鎸夐挳銆傛搷浣滃涓嬪浘锛�
聽 聽 聽鏈夌殑浜哄氨浼氶棶浜嗭紝杩欓噷鎬庝箞娌℃湁鐏嫄娴忚鍣ㄧ殑閫夐」鍟婏紵閭f垜搴旇鎬庝箞娣诲姞鐏嫄娴忚鍣ㄧ殑閫夐」鍛紵鍦╓eb Browser鐨勮绐楀彸杈规湁涓狽ew鎸夐挳锛岀偣鍑诲畠娣诲姞澶栭儴娴忚鍣ㄥ氨浼氭湁鐏嫄娴忚鍣ㄧ殑閫夐」浜嗭紝鐒跺悗鍦ㄥ嬀閫夌伀鐙愭祻瑙堝櫒灏卞彲浠ヤ簡
聽 聽2.7銆丒clipse浠g爜妯℃澘鐨勬瀯寤猴紝褰撲綘瀵规煇涓�娈典唬鐮佸啓鐨勬瘮杈冨帉鐑︾殑鏃跺�欙紝浣犲彲浠ユ瀯寤轰唬鐮佹ā鏉匡紝閫氳繃妯℃澘鍚嶇О鏉ュ垱寤哄嚭浣犵殑妯℃澘鍐呭锛屼緥濡傦細褰撲綘杈撳叆try_catch_finally锛屽苟鎸変笅鍥炶溅閿紝灏变細鍑虹幇濡備笅浠g爜鐗囨
try{
}catch(Exception e) {
thrownewRuntimeException(e);
}finally{
}
聽 聽 聽 聽涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Templates锛屾壘鍒癑ava 鈫� Editor聽鈫� Templates锛岀偣鍑籒ew鎸夐挳锛岃嚜瀹氫箟浠g爜妯℃澘锛屾渶鍚庣偣鍑籄pply and Close 鎸夐挳銆傛搷浣滃涓嬪浘锛�
聽 聽浠g爜妯℃澘鏋勫缓鎿嶄綔濡備笅鍥撅細
聽 聽2.8銆丒clipse蹇嵎閿厤缃�
聽 聽 聽聽聽 涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Keys锛屾壘鍒癎eneral聽鈫� Keys锛屽湪Keys瑙嗙獥鐨勮緭鍏ユ涓�
聽 聽 聽 聽 聽 聽 聽杈撳叆Debug Java Application锛屾壘鍒板畠淇敼瀹冪殑Binding涓篈lt+E
聽 聽 聽 聽 聽 聽 聽杈撳叆Debug JUnit Test锛屾壘鍒板畠淇敼瀹冪殑Binding涓篈lt+R
聽 聽 聽 聽 聽 聽聽 杈撳叆Debug on Server锛屾壘鍒板畠淇敼瀹冪殑Binding涓篈lt+Q
聽 聽 聽 聽 聽 聽 鎿嶄綔濡備笅鍥撅細
聽 聽 聽 聽浜屻�� 淇敼瀹屼箣鍚庯紝鍦ㄨ緭鍏ユ涓緭鍏ヤ綘淇敼鐨勫揩鎹烽敭锛屼緥濡傦細鍦ㄨ緭鍏ユ涓緭鍏lt+E锛岀湅鏄惁浼氭湁蹇嵎閿啿绐侊紝濡傛灉鏈夊啿绐侊紝鐐瑰嚮鍐茬獊鐨勯偅涓�琛岄�夐」锛屽啀鐐瑰嚮Unbind Command鍗冲彲瑙i櫎蹇嵎閿粦瀹氬嵆鍙��
聽 聽 2.9銆丒clipse閰嶇疆绫绘敞閲婃ā鏉垮拰鏂规硶娉ㄩ噴妯℃澘
涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Code Templates锛屾壘鍒癑ava 鈫� Code Style聽鈫� Code Templates锛屽湪Code Templates瑙嗙獥涓�夋嫨Comments,閰嶇疆娉ㄩ噴妯℃澘锛堝嵆 alt+shift+j 鎵嬪姩娣诲姞娉ㄩ噴锛屾彁绀猴細1銆佸皢鍏夋爣鏀惧埌绫诲悕涓婏紝鎸変笅蹇嵎閿� alt+shift+j 浼氭坊鍔犵被鐨勬敞閲娿��2銆佸皢鍏夋爣鏀惧埌鏂规硶鍚嶄笂锛屾寜涓嬪揩鎹烽敭 alt+shift+j 浼氭坊鍔犳柟娉曠殑娉ㄩ噴锛�
聽 聽 聽 聽 聽1銆侀�夋嫨Comments聽鈫� Types 閰嶇疆绫荤殑娉ㄩ噴妯℃澘锛堝嵆 鎵嬪姩娣诲姞娉ㄩ噴锛夛紝鍙屽嚮Types锛屾坊鍔犲涓嬩唬鐮佸埌浣犵殑Pattern涓細
/**
*
* @鐗堟潈 : Copyright (c)2017-2018*********鍏徃鎶�鏈紑鍙戦儴
* @author: 浣滆�呭鍚�(涓�鑸槸鍐欏鍚嶇殑鎷奸煶)
* @E-mail:閭
* @鐗堟湰:1.0
* @鍒涘缓鏃ユ湡: ${date} ${time}
* @ClassName ${type_name}
* @绫绘弿杩�-Description:${todo}(杩欓噷鐢ㄤ竴鍙ヨ瘽鎻忚堪杩欎釜鏂规硶鐨勪綔鐢�)
* @淇敼璁板綍:
* @鐗堟湰:1.0
*/
聽 聽 聽 聽2銆侀�夋嫨Comments聽鈫� Methods 閰嶇疆鏂规硶鐨勬敞閲婃ā鏉匡紙鍗� 鎵嬪姩娣诲姞娉ㄩ噴锛夛紝鍙屽嚮Methods锛屾坊鍔犲涓嬩唬鐮佸埌浣犵殑Pattern涓細
/**
* @Title: ${enclosing_method}
* @Description: ${todo}(杩欓噷鐢ㄤ竴鍙ヨ瘽鎻忚堪杩欎釜鏂规硶鐨勪綔鐢�)
* ${tags}聽 聽 鍙冩暩鎻忚堪
* @return ${return_type}聽 杩斿洖绫诲瀷
* @throws
*/
聽 聽 鎿嶄綔濡備笅鍥� 锛�
聽 聽绫绘敞閲婃ā鏉块厤缃細
聽 聽 鏂规硶娉ㄩ噴妯℃澘閰嶇疆锛�
聽聽聽浜屻�佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Code Templates锛屾壘鍒癑ava 鈫� Code Style聽鈫� Code Templates锛屽湪Code Templates瑙嗙獥涓�夋嫨Code, 閰嶇疆浠g爜妯℃澘锛堝嵆 鍒涘缓绫绘椂锛岃嚜鍔ㄧ敓鎴愭敞閲婏級
1銆侀�夋嫨Code 鈫� New Java files 閰嶇疆鍒涘缓绫绘椂鐨勬敞閲婃ā鏉匡紙鍗� 鑷姩鐢熸垚娉ㄩ噴锛夛紝鍙屽嚮New Java files锛屽湪${filecomment}
${package_declaration} 鍜屄� ${typecomment} ${type_declaration} 涔嬮棿
娣诲姞濡備笅浠g爜鍒颁綘鐨凱attern涓細
/**
*
* @鐗堟潈 : Copyright (c)2017-2018*********鍏徃鎶�鏈紑鍙戦儴
* @author: 浣滆�呭鍚�(涓�鑸槸鍐欏鍚嶇殑鎷奸煶)
* @E-mail:閭
* @鐗堟湰:1.0
* @鍒涘缓鏃ユ湡: ${date} ${time}
* @ClassName ${type_name}
* @绫绘弿杩�-Description:${todo}(杩欓噷鐢ㄤ竴鍙ヨ瘽鎻忚堪杩欎釜鏂规硶鐨勪綔鐢�)
* @淇敼璁板綍:
* @鐗堟湰:1.0
*/
聽 鎿嶄綔濡備笅鍥� 锛�
聽 绫绘敞閲婃ā鏉块厤缃細
聽 3.0銆丒clipse鑳屾櫙棰滆壊閰嶇疆
聽 聽聽 涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Text Editors锛屾壘鍒癎eneral 鈫� Editors 鈫� Text Editors锛屽湪Text Editors瑙嗙獥涓殑Appearance color options涓�夋嫨 Background color锛屾妸鍙宠竟鐨凷ystem Default鐨勫嬀閫夊幓鎺夛紝鐐瑰嚮Color鏃佽竟鐨勯鑹查�夋嫨妗嗭紝鎿嶄綔濡備笅鍥� 锛�
聽 聽 聽鍦ㄥ脊鍑虹殑棰滆壊閫夋嫨妗嗕腑 鐐瑰嚮瑙勫畾鑷畾涔夐鑹�(D)鎸夐挳锛岃缃壊璋�(E)锛�85锛岄ケ鍜屽害(S)锛�123锛屼寒搴�(L)锛�205鍗冲彲锛屽搴旂殑绾�(R) 缁�(G) 钃�(U) 浼氫綔鐩稿簲鐨勫彉鍖栵紝鍦ㄧ偣鍑荤‘瀹氬嵆鍙� 鎿嶄綔濡備笅鍥撅細
聽 聽 3.1銆丒clipse瀛椾綋澶у皬璁剧疆
聽 聽 聽 涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Colors and Fonts锛屾壘鍒癎eneral 鈫� Appearance 鈫� Colors and Fonts锛屽湪Colors and Fonts瑙嗙獥涓殑Basic 涓�夋嫨 Text Font锛岀偣鍑诲彸杈圭殑Edit锛岄�夋嫨鐩稿簲鐨勫瓧浣撳ぇ灏忓嵆鍙紝鎿嶄綔濡備笅鍥� 锛�
聽瀛椾綋澶у皬鍜岄鏍煎彲浠ユ牴鎹釜浜虹殑鐖卞ソ闅忔剰璁剧疆锛屽涓嬫槸鎴戣嚜宸辩殑璁剧疆锛�
聽 3.2銆丒clipse鍘绘帀绫诲悕鎴栬�呮帴鍙e悕鍓嶈嚜鍔ㄦ坊鍔犱笂鐨勫寘鍚�
聽 聽 聽 聽褰撴垜浠緭鍏ist骞剁偣鍑诲洖杞︽椂锛岃緭鍑轰簡聽聽java.util.List
聽 聽聽 涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Content Assist锛屾壘鍒癑ava 鈫� Editor 鈫� Content Assist锛屽湪Content Assist瑙嗙獥涓嬀閫堿dd import instead of qualified name閫夐」鍗冲彲锛屾搷浣滃涓嬪浘 锛�
3.3銆� Eclipse璁剧疆涓嶆牸寮忓寲娉ㄩ噴
聽 聽 聽 聽聽聽涓�銆佹壘鍒� Window聽鈫� Preferences锛屽湪宸︿笂瑙掔殑杈撳叆妗嗕腑杈撳叆Formatter锛屾壘鍒癑ava聽鈫� Code Style 鈫� Formatter
浜屻�佷箣鍚庣偣鍑籒ew鎸夐挳锛屾柊寤轰竴涓睘浜庤嚜宸辩殑Active profile锛堝悕瀛楄嚜瀹氾級锛岃浣忎笉瑕佷娇鐢╡clipse鑷甫鐨凙ctive profile
聽涓夈�佷箣鍚庝細寮瑰嚭涓�涓紪杈戠晫闈紝閫変腑Comments锛屽彇娑堝嬀閫夆�淓nable Javadoc comment formatting鈥濓紝鏈�鍚庣偣鍑籓K鎸夐挳
鍥涖�佹煡鐪婣ctive profile鏄惁鏄嚜宸卞垱寤虹殑Active profile锛屾渶鍚庣偣鍑籄pply and Close
聽 Eclipse鐨勯厤缃氨鏆傛椂鍒拌繖浜嗐��