kukooBlog

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

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            213 隨筆 :: 0 文章 :: 285 評論 :: 0 Trackbacks

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

          編譯器(Compiler)

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

          • 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開始,可以單獨下載獨立的JDT編譯器,大約只有1MB大小(Apache Tomcat就在使用Eclipse的JDT編譯器)。這個命令行工具,和javac兼容。

          編輯(Editing)

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

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

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

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

          運行和測試(Running)

          在3.2中,可以同時運行多個測試案例(test suite),而且,3.2開始支持JUnit 4.0了。

          團隊工作(Team Working)

          Eclispe 3.2現在可以通過讀取CVS的歷史記錄,來高亮度的顏色標記來提示當前行哪個其他的程序員做過改動,如果把鼠標移到這個高亮顏色塊上,會顯示出程序員的名字,日期和所做的批注。

          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提供了一個新的Clean Up向導來進一步格式化和清潔代碼:

          • 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).

          【參考】部分內容節譯自 《What's New in Eclipse 3.2 Java Development Tools


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

          評論

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

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

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

          # re: Eclipse 3.2中JDT的新特性 2006-07-01 22:27 kukooBlog
          MM的評論比較有道理。 不過,Ctrl-Space和中文輸入法的沖突,應該還是以修改中文輸入法來解決  回復  更多評論
            

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

          主站蜘蛛池模板: 汝阳县| 蓬安县| 会同县| 漳浦县| 壤塘县| 海宁市| 佛教| 永吉县| 潮州市| 桂林市| 汶上县| 上栗县| 七台河市| 徐水县| 中西区| 荥阳市| 股票| 上林县| 隆化县| 陆川县| 临西县| 新建县| 奎屯市| 抚松县| 清远市| 商南县| 平塘县| 满城县| 原平市| 获嘉县| 清远市| 青神县| 稻城县| 自治县| 凤冈县| 株洲县| 淅川县| 津南区| 古浪县| 湘乡市| 福建省|