protected IAction getAction(String id) { if (id == null || id.length() == 0) { return null; } // Keep a cache, rather than creating a new action each time, // so that image caching in ActionContributionItem works. IAction action = (IAction) getActions().get(id); if (action == null) { IWizardDescriptor descriptor = wizardRegistry.findWizard(id); if (descriptor != null) { action = new WizardShortcutAction(window, descriptor); getActions().put(id, action); } } return action; }
public static IWizard createWizard(String id) { // First see if this is a "new wizard". IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(id); // If not check if it is an "import wizard". if (descriptor == null) { descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(id); } // Or maybe an export wizard if (descriptor == null) { descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(id); } try { // Then if we have a wizard, open it. if (descriptor != null) { IWizard wizard = descriptor.createWizard(); return wizard; } } catch (CoreException e) { e.printStackTrace(); } return null; }
@Override public void updateElement(UIElement element, Map parameters) { String wizardId = (String) parameters.get(getWizardIdParameterId()); if (wizardId == null) return; IWizardDescriptor wizard = getWizardRegistry().findWizard(wizardId); if (wizard != null) { element.setText(NLS.bind(WorkbenchMessages.WizardHandler_menuLabel, wizard.getLabel())); element.setTooltip(wizard.getDescription()); element.setIcon(wizard.getImageDescriptor()); } }
private IAction getAction(String id) { // Keep a cache, rather than creating a new action each time, // so that image caching in ActionContributionItem works. IAction action = (IAction) actions.get(id); if (action == null) { IWizardDescriptor wizardDesc = WorkbenchPlugin.getDefault() .getNewWizardRegistry().findWizard(id); if (wizardDesc != null) { action = new NewWizardShortcutAction(workbenchWindow, wizardDesc); actions.put(id, action); IConfigurationElement element = Adapters.adapt(wizardDesc, IConfigurationElement.class); if (element != null) { workbenchWindow.getExtensionTracker().registerObject( element.getDeclaringExtension(), action, IExtensionTracker.REF_WEAK); } } } return action; }
public void openWizard(Shell shell, IWorkbench workbench, IStructuredSelection selection, String id) { // First see if this is a "new wizard". IWizardDescriptor descriptor = PlatformUI.getWorkbench() .getNewWizardRegistry().findWizard(id); // If not check if it is an "import wizard". if (descriptor == null) { descriptor = PlatformUI.getWorkbench().getImportWizardRegistry() .findWizard(id); } // Or maybe an export wizard if (descriptor == null) { descriptor = PlatformUI.getWorkbench().getExportWizardRegistry() .findWizard(id); } try { // Then if we have a wizard, open it. if (descriptor != null) { IWizard wizard = descriptor.createWizard(); ((IWorkbenchWizard) wizard).init(workbench, selection); WizardDialog wd = new WizardDialog(shell, wizard); wd.setTitle(wizard.getWindowTitle()); wd.open(); } } catch (CoreException e) { e.printStackTrace(); } } }
private IWizard createChildWizard(String id, String parentWizModelName) { NewProjectDataModelFacetWizard wizard = null; IWizardRegistry newWizardRegistry = WorkbenchPlugin.getDefault().getNewWizardRegistry(); IWizardDescriptor wizardDescriptor = newWizardRegistry.findWizard(id); try { // retrieve the model of the parent wizard IDataModel parentWizModel = getDataModel().getNestedModel(parentWizModelName); // create the child wizard and retrieve its model wizard = (NewProjectDataModelFacetWizard) wizardDescriptor.createWizard(); IDataModel childWizModel = wizard.getDataModel(); // copy the properties of the parent wizard's model to the child wizard's model Iterator props = parentWizModel.getBaseProperties().iterator(); while (props.hasNext()) { String prop = (String) props.next(); childWizModel.setProperty(prop, parentWizModel.getProperty(prop)); } int a = 1; } catch (CoreException ce) { Logger.getLogger().log(ce); } return wizard; }
.findWizard(wizardId); if (wizardDescriptor == null) { throw new ExecutionException("unknown wizard: " + wizardId); //$NON-NLS-1$
IWizardDescriptor descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(customWizard); if (descriptor != null) { try {