I want to open a WizardDialog from a Handler.
So I am doing this and it works:
@Execute
public void execute(){
System.out.println("Called");
WizardDialog dlg = new WizardDialog(new Shell() , new MyWizard());
if(dlg.open() == Window.OK){
}
}
But should I be doing new Shell()? I don't know since I am newbie in RCP/SWT.
I thought to use the current Shell so I did:
WizardDialog dlg = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), new MyWizard());
But I got exception:
Quote:org.eclipse.e4.core.di.InjectionException: java.lang.IllegalStateException: Workbench has not been created yet.
Note that my main window is open and I press the menuitem button and from its handler I try to open the WizardDialog. How is it possible that the Workbench is not initialized at this point? I see the window!
Could you please help me out?
[Updated on: Sat, 01 September 2012 20:09]
Report message to a moderator