2014-06-10 101 views
2

即時嵌入eclipse rcp應用程序。我有2個角度,Perspective1是在應用程序啓動時默認打開的,而Perspective2.i有一個任務,我必須在按鈕單擊時打開perspective2並關閉打開的Perspective1。怎麼做 ?Eclipse RCP - 按鈕點擊打開透視

回答

2

獲取工作臺從某處,例如:

IWorkbench workbench = PlatformUI.getWorkbench(); 

獲取要打開從某個角度工作臺窗口,例如:

IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); 

顯示角度:

workbench.showPerspective("perspective-id", window);