kukooBlog

          look to the master, follow the master, walk with the master, see through the master, become the master.

            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            213 隨筆 :: 0 文章 :: 285 評(píng)論 :: 0 Trackbacks

          Eclipse 3.2(以及Eclipse Callisto)在6月30日就要release了,為此,Ed Burnette專門寫了一篇報(bào)道:What's New in Eclipse 3.2 Java Development Tools,著重介紹在Eclipse 3.2中JDT的新特性:

          編譯器(Compiler)

          Eclipse 3.2開始支持Java SE 6.0,同時(shí)增加了更多的編譯診斷工具,比如:

          • Using variables that are obviously null.
          • Unnecessary checks against null.
          • Accidentally assigning to method parameters.
          • Switch cases entered by falling through previous cases.
          • Using non-generic (raw) types.
          • Unused labels.
          • Unnecessary $NON-NLS$ tags.

          從Eclipse 3.2開始,可以單獨(dú)下載獨(dú)立的JDT編譯器,大約只有1MB大小(Apache Tomcat就在使用Eclipse的JDT編譯器)。這個(gè)命令行工具,和javac兼容。

          編輯(Editing)

          編輯器中增強(qiáng)的一個(gè)功能是Ctrl-Space,比如一個(gè)非常長(zhǎng)的變量名: LongJavaName,只要打入"LJN",然后通過(guò)Ctrl-Space,編輯器就知道你需要LongJavaName這個(gè)變量。這個(gè)功能被稱之為CamelCase completion.

          另一個(gè)增強(qiáng)是: 比如你需要 StringBuffer buffer = new StringBuffer();,你不需要全部自己輸入了,在3.2中,嘗試這樣做:輸入SB,Ctrl-Space, Space, Ctrl-Space, 輸入 = new , Ctrl-Space, 輸入();。這是不是大大縮短了擊鍵的次數(shù)呢?

          另外一個(gè)功能稱之為"rename type"。 比如你有一個(gè)類型Bar,通常你可能會(huì)命名你的變量為fBar,把方法命名為createBar()。 那么,如果你通過(guò)重構(gòu)把Bar給改名了,3.2將嘗試同時(shí)改正 fBarcreateBar()

          When you rename a type in Eclipse 3.2, it offers to rename variables and methods that have similar names

          運(yùn)行和測(cè)試(Running)

          在3.2中,可以同時(shí)運(yùn)行多個(gè)測(cè)試案例(test suite),而且,3.2開始支持JUnit 4.0了。

          團(tuán)隊(duì)工作(Team Working)

          Eclispe 3.2現(xiàn)在可以通過(guò)讀取CVS的歷史記錄,來(lái)高亮度的顏色標(biāo)記來(lái)提示當(dāng)前行哪個(gè)其他的程序員做過(guò)改動(dòng),如果把鼠標(biāo)移到這個(gè)高亮顏色塊上,會(huì)顯示出程序員的名字,日期和所做的批注。

          CVS Quick Diff annotations show color-based annotations of who did what in the file. Hovering over a section shows the details of that revision.


          清潔代碼 (Code Hygiene)

          3.2提供了一個(gè)新的Clean Up向?qū)?lái)進(jìn)一步格式化和清潔代碼:

          • Remove unused imports.
          • Remove unused private methods and constructors.
          • Add missing @Override and @Deprecated annotations.
          • Add missing $NON-NLS$ tags, or remove unnecessary ones.
          • Convert all for loops to be enhanced-for loops.
          • Convert control statement bodies to blocks.
          • Remove unnecessary casts.
          • Add serial version ID to Serializable and Externalizable classes.

          The Clean Up wizard lets you apply consistent standards across your entire project (Click for full-size image).

          【參考】部分內(nèi)容節(jié)譯自 《What's New in Eclipse 3.2 Java Development Tools


          posted on 2006-06-29 14:18 kukooBlog 閱讀(3377) 評(píng)論(5)  編輯  收藏 所屬分類: Eclipse

          評(píng)論

          # re: Eclipse 3.2中JDT的新特性 2006-06-29 17:02 goingmm
          @{ "SB," Ctrl-Space, Space, Ctrl-Space, " = new ", Ctrl-Space, "();"}
          寫代碼像彈鋼琴,挺逗... 但是‘Ctrl’ 和 ‘Space’鍵壞了,沒辦法單獨(dú)換啊!~
          @{通過(guò)讀取CVS的歷史記錄,來(lái)高亮度的顏色標(biāo)記來(lái)提示當(dāng)前行哪個(gè)其他的程序員做過(guò)改動(dòng)}
          這個(gè)功能挺cool
            回復(fù)  更多評(píng)論
            

          # re: Eclipse 3.2中JDT的新特性 2006-06-29 18:35 kukooBlog
          MM,一個(gè)鍵盤花不了您老多少錢啊  回復(fù)  更多評(píng)論
            

          # re: Eclipse 3.2中JDT的新特性 2006-07-01 14:33 goingmm
          Eclipse3.2 finally 試用
          1)"Ctrl-Space" 沒有試出來(lái)效果,我都把輸入法熱鍵改了[imetool工具可以把輸入法熱鍵改回來(lái),比如:開關(guān)輸入法Ctrl+Space Windows設(shè)置不支持]可能還有其他熱鍵沖突吧!
          2)"rename type":在Refactor→Rename 注意幾個(gè)細(xì)節(jié)
          ①勾選Update similarly named variables and methods
          ②允許配置你需要替換的規(guī)則[點(diǎn)Configure...]
          ③方法如果返回類型不是你的對(duì)象,不能更改
          ④反復(fù)改了幾十次,突然報(bào)錯(cuò)了,重起Eclipse又好了
          3)單獨(dú)為一個(gè)項(xiàng)目切換JRE比較方便
          直接右鍵JRE System... 然后選Configure...
          接著勾選Alernate JRE 最后選擇需要的JRE
          4)其他功能需要的時(shí)候再試!
            回復(fù)  更多評(píng)論
            

          # re: Eclipse 3.2中JDT的新特性 2006-07-01 22:27 kukooBlog
          MM的評(píng)論比較有道理。 不過(guò),Ctrl-Space和中文輸入法的沖突,應(yīng)該還是以修改中文輸入法來(lái)解決  回復(fù)  更多評(píng)論
            

          # re: Eclipse 3.2中JDT的新特性 2006-11-24 13:11 wmh
          不覺的用alt+/ 更好嗎 ctrl+space 與輸入法有沖突  回復(fù)  更多評(píng)論
            

          主站蜘蛛池模板: 许昌县| 新建县| 冷水江市| 宜宾县| 呼玛县| 高雄县| 乐清市| 札达县| 沽源县| 鄂尔多斯市| 邹平县| 邵东县| 桂林市| 汝阳县| 牡丹江市| 肇源县| 永吉县| 丰原市| 丁青县| 清丰县| 榆社县| 类乌齐县| 六盘水市| 孟州市| 福海县| 福州市| 琼中| 宜春市| 芮城县| 潮安县| 米林县| 门头沟区| 樟树市| 原阳县| 平原县| 新邵县| 赣州市| 贵溪市| 宁德市| 德惠市| 朔州市|