IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
if (activeWorkbenchWindow == null) {
// action has been disposed
return;
}
XVRNewWizard wizard = new XVRNewWizard();
wizard.setCategoryId(categoryId);
String param = event.getParameter("org.xvr.xvrengine.command.parameter.projects_only");
boolean prjs_only = param != null && Boolean.parseBoolean(param);
wizard.setProjectsOnly(prjs_only);
param = event.getParameter("org.xvr.xvrengine.command.parameter.resources_only");
boolean res_only = param != null && Boolean.parseBoolean(param);
wizard.setResourcesOnly(res_only);
IStructuredSelection selectionToPass = getSelectionToUse(event);
wizard.init(activeWorkbenchWindow.getWorkbench(), selectionToPass);
IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault()
.getDialogSettings();
IDialogSettings wizardSettings = workbenchSettings
.getSection("NewWizardAction"); //$NON-NLS-1$
if (wizardSettings == null) {
wizardSettings = workbenchSettings.addNewSection("NewWizardAction"); //$NON-NLS-1$
}
wizard.setDialogSettings(wizardSettings);
wizard.setForcePreviousAndNextButtons(true);
Shell parent = activeWorkbenchWindow.getShell();
WizardDialog dialog = new WizardDialog(parent, wizard);
dialog.create();