Reputation: 863
I have a RCP applicaton from which I need to show a GEF Editor in a modal "dialog". But since the editor framework seems to be tightly coupled to the use of a workbench window etc I need to find a why to open a new workbench window (with its own WorkbenchWindowAdvisor etc) so that I can open my GEF editor within this workbench window. Once I get this workbenchWindow opened I will set the style of the WorkbenchWindow's shell to be application modal.
Upvotes: 1
Views: 1944
Reputation: 12718
I have done this in a customer project using the following components:
openNewWindow(String type, ...)
. This is the method you call to open a new window. The type argument specifies the wanted type of window.ILocalWorkbenchWindowAdvisor
and the initial perspective ID.IWorkbench.openWorkbenchWindow(perspectiveID, ...)
ApplicationWorkbenchAdvisor.createWorkbenchWindowAdvisor(...)
a new advisor is create based on the saved ILocalWorkbenchWindowAdvisor
- the returned advisor basically delegates all the postWindowCreate(...)
, etc to the same methods in ILocalWorkbenchWindowAdvisor
...ILocalWorkbenchWindowAdvisor
is saved - which is the case for the very first window to be opened - the type "mainWindow" is looked up and used...It works pretty well and let all parts of the project add new windows as needed.
Upvotes: 2
Reputation: 4892
Use the command "org.eclipse.ui.window.newWindow" to open a new window. In your WorkbenchWindowAdvisor.preWindowOpen(), set the shell style on the IWorkbenchWindowConfigurer to be application modal. You can also hide the coolbar, menu and status bars, so it looks more like a dialog than a window.
Upvotes: 0