@Override protected IProject createTheProject() throws Exception { final IWorkbench theWorkbench = get_the_workbench(); final IWizardRegistry theNewWizardRegistry = theWorkbench.getNewWizardRegistry(); final IWizardDescriptor wizardDescriptor = theNewWizardRegistry.findWizard(Activator.EXAMPLE_WIZARD_ID); final IWorkbenchWizard theWizard = wizardDescriptor.createWizard(); theWizard.init(theWorkbench, StructuredSelection.EMPTY); final WizardDialog theDialog = new WizardDialog(null, theWizard); theDialog.setBlockOnOpen(false); theDialog.open(); select_the_default_button(theDialog); return get_the_project(getTheProjectName()); }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { String wizardId = getWizardIdParameterId(); IWorkbenchWindow activeWindow = HandlerUtil.getActiveWorkbenchWindowChecked(event); if (wizardId == null) { IAction wizardAction = createWizardChooserDialogAction(activeWindow); wizardAction.run(); } else { IWizardRegistry wizardRegistry = getWizardRegistry(); IWizardDescriptor wizardDescriptor = wizardRegistry.findWizard(wizardId); if (wizardDescriptor == null) { throw new ExecutionException("unknown wizard: " + wizardId); //$NON-NLS-1$ } try { IWorkbenchWizard wizard = wizardDescriptor.createWizard(); ISelection selection = activeWindow.getSelectionService().getSelection(); IStructuredSelection ss = selection instanceof IStructuredSelection ? (IStructuredSelection) selection : StructuredSelection.EMPTY; wizard.init(PlatformUI.getWorkbench(), ss); if (wizardDescriptor.canFinishEarly() && !wizardDescriptor.hasPages()) { wizard.performFinish(); return null; } Shell parent = activeWindow.getShell(); createAndOpenWizardDialog(parent, wizard); } catch (CoreException ex) { throw new ExecutionException("error creating wizard", ex); //$NON-NLS-1$ } } return null; }
/** * Return whether or not any examples are in the current install. * * @return True if there exists a full examples wizard category. */ private boolean hasExamples() { IWizardRegistry newRegistry = PlatformUI.getWorkbench().getNewWizardRegistry(); IWizardCategory category = newRegistry.findCategory(FULL_EXAMPLES_WIZARD_CATEGORY); return category != null; }
@Override protected IWizardRegistry getWizardRegistry() { return PlatformUI.getWorkbench().getNewWizardRegistry(); }
@Override public IWizardRegistry getNewWizardRegistry() { // TODO Auto-generated method stub return null; }
@Override public IWizardRegistry getImportWizardRegistry() { // TODO Auto-generated method stub return null; }
@Override public IWizardRegistry getExportWizardRegistry() { // TODO Auto-generated method stub return null; }
/** * Returns the wizard registry for the concrete <code>WizardHandler</code> implementation class. * * @return The wizard registry for the concrete <code>WizardHandler</code> implementation class. */ protected abstract IWizardRegistry getWizardRegistry();
/** * Return the new wizard registry. * * @return the new wizard registry * @since 3.1 */ public IWizardRegistry getNewWizardRegistry();
/** * Return the import wizard registry. * * @return the import wizard registry * @since 3.1 */ public IWizardRegistry getImportWizardRegistry();
/** * Return the export wizard registry. * * @return the export wizard registry * @since 3.1 */ public IWizardRegistry getExportWizardRegistry();