星期三, 8月 10, 2005

[java] eclipse distilled 心得

distilled
i. (不及物動詞 intransitive verb)
1. 蒸餾;精鍊
The liquor distills easily.
這種酒易蒸餾。
2. 作為精華產生
3. 滲出;滴下

ch1.
1.eclipse platform 是由架構在 runtime 之上的其他功能
2.web tool platform - j2ee /web-centric application(e.g. MVC) 是eclipse 家族最新加入的產品
3.eclipse support and accelerate iteration agile development cycle.
agile 是一組方法論的集合,包括XP , scrum ,crystal methodology, adaptive software development。
eclipse 提供continous testing, refactoring, continuous integration, collective ownership and code standards.


ch2.

開啟專案時記得選取separate source and output folders

1. 更改code template
window -preference => java -code style -code templates => code - new java files, code- comment - Type
2.產生 javadoc 的comment 快速鍵是alt + shift + J
3.產生getter/setter 是在 source - generate getter/setter 選項
4.設定java vm memory size

重要觀念 開啟順序
java project => java package => java classes
若要import 一個project進來呢? 使用哪一個package?

ch3 manage your project
eclipse resource perspective 提供依個跨平台logic view of 檔案,但在eclipse外部的檔案更動(e.g.新增、刪除等動作),要使用synchornize機制讓eclipse 與外部變動一致。

專案的目錄結構來說
1. workspace 包含一到數個project(s),而project 包含不定數量的檔案與目錄
設定window- preferences -workbench =>workbench automatic reload

2.eclipse中要連結外部資源(目錄)是可能的.
外部目錄位置可以是相對於某一路境變數(path variable)之上。舉例來說,若某路徑變數a設為/path/to/,指向tomcat實體的路徑 {a}/tomcat;
這樣做有利於專案的控管,和程式員之間的資源共享。若要轉移專案到其他機器上,只要重新指定路徑變數即可。
[用法]
New / folder | file dialog中 勾選linked sources 並設定 varibles。
extend variable 可以重新指定variable 目錄下的其他目錄,縮小變數(目錄)範圍。
所有外部連結的資訊會寫進.project檔案之中
每個java project都有.classpath這個檔

break project into subproject have two benefit

ch4.
*perspective collection of views and actions
*select of capabilities (minium set of views and options) 決定最基本的選單與視景

*view 顯示目前workbench內容的相關資訊,不同的plugins 共享基本的 views.
並且對不同plugin在不同選單,狀況下會有不同的反應。另外,view之間會相互影響
選了view的部份功能,可能會影響其他視景的呈現。

filter view 降低information overload問題
例如在problem view的filter 設定中,選擇On any resource in same project來降低錯誤訊息的數量

pref->java->task tags-> new ...可以增加task Tag

fast view 再任何一個view上選 fast view ,可以讓這個view 變成fast view.
fast view 讓view藉由點選快速的顯現/隱藏。

在navigator 中在任何文檔上按右鍵,可以選擇open with 選項利用eclipse 設定的editor來開啟。
否則點選兩下,eclipse會用預設的編輯器來開啟。不同類型的檔案預設的編輯器會不一樣,譬如說doc檔案就會使用m$ word程式開啟。改變檔案預設的編輯器可以到pref ->work bench->File Association。

可以輸出目前的preference給其他eclipse使用,使用file->export

另外,有些preference 屬於team pref. 團隊中共享這些pref有助於整合檔案
code style and format...
code templates之類的
compiler options...

目前對pref 的改變都是針對workspace scope, 目前沒有針對小單位project 或者整個ide 範圍的pref設定,未來版本說不定會有

ch5 editor and outline

選擇某種type (e.g String / Catalog(自訂)) 按下F3,就會另外開一個editor 編輯此依type
如果想查詢某種類別是否存在在系統中,可以利用ctrl + shift + T 查詢對話窗。

沒有留言: