為了讓偶寫(xiě)的
eclipse系統(tǒng)托盤(pán)插件EaseTray1.0插件能在eclipse啟動(dòng)時(shí)加載,泡了半天書(shū)店,在于找到了怎么讓eclipse啟動(dòng)時(shí)執(zhí)行指定的程序,離解決問(wèn)題又近了一步。現(xiàn)在和大家分享下收獲。
新建一個(gè)插件項(xiàng)目,增加一個(gè)org.eclipse.ui.startup擴(kuò)展點(diǎn),

指向直接寫(xiě)的test.EasyStartup類(lèi)
EasyStartup:
?1?package?test;
?2?
?3?import?org.eclipse.swt.widgets.Display;
?4?import?org.eclipse.ui.IStartup;
?5?
?6?public?class?EasyStartup?implements?IStartup?{
?7?????public?void?earlyStartup()?{
?8?????????Display.getDefault().syncExec(new?Runnable()?{
?9?????????????public?void?run()?{
10?????????????????System.out.println("hello?start");
11?????????????}
12?????????});
13?????}
14?
15?}
作為插件運(yùn)行,控制臺(tái)會(huì)輸出:
hello start
呵呵,小小的成功。
但是我還是無(wú)法獲取IWorkbenchWindow對(duì)象。。。。。。。。
這樣我的插件還是不能啟動(dòng)時(shí)強(qiáng)制加載并初始化。。。。。。。。
誰(shuí)知道怎么獲取IWorkbenchWindow!?
posted on 2006-12-31 14:38
交口稱(chēng)贊 閱讀(3938)
評(píng)論(21) 編輯 收藏 所屬分類(lèi):
Eclipse RCP SWT