close
這一章前面是更詳細的介紹了 eclipse 的各種 view 以及 working set,後面則是介紹跟 coding 有關的部分,原本已經知道 refactoring,但我沒想到 eclipse 也有與 Visual studio 相似的 code snippet 與 T4,對應的就是 template,另外還有類似直譯器的 scrapbook。

Template 可以自訂要出現的程式片斷、註解等等,除此之外,也可以安插一些變數,這樣就可以做出更多變化。設定是在 Preferences 裡設定 (關鍵字就是 templates),有好幾個地方,差別是在於範圍。你甚至可以指定,這樣的程式片斷還需要 import 哪些 packages。搭配後面提到的 Code assistant (類似 Visual studio 的 intellience),可以快速安插 template,Code assistant 除了可以搭配 template,他也會自己去列出可能符合的 method、variable,讓開發者可以很快的挑選。

Generator 可以說是更強大的 template,不過可客製性就沒有 Template 那麼大,這裡就只有介紹 getter/setter 。新增 Scrapbook 以後,會出現一個 Scrapbook page,讓你可以直接輸入 java code 做簡單的試用。

More about Android Apps with Eclipse
arrow
arrow

    elleryq 發表在 痞客邦 留言(0) 人氣()