@Override public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } };
@Override public String getId() { return wizardDescriptor.getId(); }
@Override public String getLabel() { return wizardDescriptor.getLabel() + separator + wizardDescriptor.getDescription(); }
wizard = (INewWizard) wizardElement.createWizard(); } catch (CoreException e) { ErrorDialog.openError(window.getShell(), WorkbenchMessages.NewWizardShortcutAction_errorTitle, if (selection instanceof IStructuredSelection) { selectionToPass = wizardElement .adaptedSelection((IStructuredSelection) selection); } else { if (wizardElement.canFinishEarly() && !wizardElement.hasPages()) { wizard.performFinish(); dialog.close();
IWorkbenchWizard wizard = wizardDescriptor.createWizard(); wizard.init(PlatformUI.getWorkbench(), getSelectionToUse(event)); if (wizardDescriptor.canFinishEarly() && !wizardDescriptor.hasPages()) { wizard.performFinish(); return null;
/** * Create an instance of this class. * * @param window the workbench window in which this action will appear * @param wizardDesc a wizard element */ public NewWizardShortcutAction(IWorkbenchWindow window, IWizardDescriptor wizardDesc) { super(wizardDesc.getLabel()); setToolTipText(wizardDesc.getDescription()); setImageDescriptor(wizardDesc.getImageDescriptor()); setId(ActionFactory.NEW.getId()); wizardElement = wizardDesc; this.window = window; }
String string = ""; //$NON-NLS-1$ if (selectedObject != null) { string = selectedObject.getDescription(); ImageDescriptor descriptor = null; if (selectedObject != null) { descriptor = selectedObject.getDescriptionImage();
private void addParameterValues(Map values, IWizardCategory wizardCategory) { for (final IWizardDescriptor wizardDescriptor : wizardCategory.getWizards()) { // Note: using description instead of label for the name // to reduce possibilities of key collision in the map // final String name = wizardDescriptor.getDescription(); // by request String name = wizardDescriptor.getLabel(); final String id = wizardDescriptor.getId(); final String value = (String) values.get(name); if (value!=null && !value.equals(id)) { name = name + " (" + id + ")"; //$NON-NLS-1$//$NON-NLS-2$ } values.put(name, id); } for (final IWizardCategory childCategory : wizardCategory.getCategories()) { addParameterValues(values, childCategory); } }
/** * @param selectedObject */ private void updateWizardSelection(IWizardDescriptor selectedObject) { selectedElement = selectedObject; WorkbenchWizardNode selectedNode; if (selectedWizards.containsKey(selectedObject)) { selectedNode = selectedWizards.get(selectedObject); } else { selectedNode = new WorkbenchWizardNode(page, selectedObject) { @Override public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } }; selectedWizards.put(selectedObject, selectedNode); } page.setCanFinishEarly(selectedObject.canFinishEarly()); page.setHasPages(selectedObject.hasPages()); page.selectWizardNode(selectedNode); updateDescription(selectedObject); } }
IWizardDescriptor descriptor = (IWizardDescriptor) shortcut .getDescriptor(); return descriptor.getDescription();
/** * Tests whether the given wizard has an associated image. * * @param selectedObject the wizard to test * @return whether the given wizard has an associated image */ private boolean hasImage(IWizardDescriptor selectedObject) { if (selectedObject == null) { return false; } if (selectedObject.getDescriptionImage() != null) { return true; } return false; }
@Override public ImageDescriptor getImageDescriptor() { return wizardDescriptor.getImageDescriptor(); }
/** * * @param aWindow * The window to use for the shell and selection service. * @param aDescriptor * The descriptor with information for triggering the desired * wizard. */ public WizardShortcutAction(IWorkbenchWindow aWindow, IWizardDescriptor aDescriptor) { super(aDescriptor.getLabel()); descriptor = aDescriptor; setToolTipText(descriptor.getDescription()); setImageDescriptor(descriptor.getImageDescriptor()); setId(ActionFactory.NEW.getId()); this.window = aWindow; }
String string = ""; //$NON-NLS-1$ if (selectedObject != null) { string = selectedObject.getDescription(); ImageDescriptor descriptor = null; if (selectedObject != null) { descriptor = selectedObject.getDescriptionImage();
/** * @param selectedObject */ private void updateWizardSelection(IWizardDescriptor selectedObject) { selectedElement = selectedObject; WorkbenchWizardNode selectedNode; if (selectedWizards.containsKey(selectedObject)) { selectedNode = (WorkbenchWizardNode) selectedWizards .get(selectedObject); } else { selectedNode = new WorkbenchWizardNode(page, selectedObject) { @Override public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } }; selectedWizards.put(selectedObject, selectedNode); } page.setCanFinishEarly(selectedObject.canFinishEarly()); page.setHasPages(selectedObject.hasPages()); page.selectWizardNode(selectedNode); updateDescription(selectedObject); } }
/** * Tests whether the given wizard has an associated image. * * @param selectedObject * the wizard to test * @return whether the given wizard has an associated image */ private boolean hasImage(IWizardDescriptor selectedObject) { if (selectedObject == null) { return false; } if (selectedObject.getDescriptionImage() != null) { return true; } return false; }
@Override public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } };
public String getPluginId() { return descriptor.getId(); }
@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()); } }
@Override public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } };