@Override public String getLabel() { return wizardDescriptor.getLabel() + separator + wizardDescriptor.getDescription(); }
@Override public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } };
@Override public String getId() { return wizardDescriptor.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()); } }
/** * Returns the child collection element for the given id */ private IWizardCategory getChildWithID(IWizardCategory parent, String id) { IWizardCategory[] children = parent.getCategories(); for (IWizardCategory currentChild : children) { if (currentChild.getId().equals(id)) { return currentChild; } } return null; }
/** * @param category the wizard category * @return whether all wizards in the category are considered primary */ private boolean allPrimary(IWizardCategory category) { for (IWizardDescriptor wizard : category.getWizards()) { if (!isPrimary(wizard)) { return false; } } for (IWizardCategory wizard : category.getCategories()) { if (!allPrimary(wizard)) { return false; } } return true; }
/** * Remove all primary wizards that are not in the wizard collection */ private void trimPrimaryWizards() { ArrayList<IWizardDescriptor> newPrimaryWizards = new ArrayList<IWizardDescriptor>(primaryWizards.length); if (wizardCategories == null) { return;//No categories so nothing to trim } for (IWizardDescriptor primaryWizard : primaryWizards) { if (wizardCategories.findWizard(primaryWizard.getId()) != null) { newPrimaryWizards.add(primaryWizard); } } primaryWizards = newPrimaryWizards.toArray(new WorkbenchWizardElement[newPrimaryWizards.size()]); }
/** * Returns whether the new wizards registry has a non-empty category with * the given identifier. * * @param categoryId * the identifier for the category * @return <code>true</code> if there is a non-empty category with the * given identifier, <code>false</code> otherwise */ protected boolean registryHasCategory(String categoryId) { return WorkbenchPlugin.getDefault().getNewWizardRegistry() .findCategory(categoryId) != null; }
/** * 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(); }
@Override public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } };
/** * Returns the child collection element for the given id */ private IWizardCategory getChildWithID( IWizardCategory parent, String id) { for (IWizardCategory wizardCategory : parent.getCategories()) { if (wizardCategory.getId().equals(id)) { return wizardCategory; } } return null; }
/** * Remove all primary wizards that are not in the wizard collection */ private void trimPrimaryWizards() { ArrayList newPrimaryWizards = new ArrayList(primaryWizards.length); if (wizardCategories == null) { return;//No categories so nothing to trim } for (IWizardDescriptor primaryWizard : primaryWizards) { if (wizardCategories.findWizard(primaryWizard.getId()) != null) { newPrimaryWizards.add(primaryWizard); } } primaryWizards = (WorkbenchWizardElement[]) newPrimaryWizards .toArray(new WorkbenchWizardElement[newPrimaryWizards.size()]); }
public String getPluginId() { return descriptor.getId(); }
/** * 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 getLocalId() { return descriptor.getId(); }
@Override public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } };
@Override public String getLocalId() { IPluginContribution contribution = getPluginContribution(); if (contribution != null) { return contribution.getLocalId(); } return wizardElement.getId(); }
@Override public IWorkbenchWizard createWizard() throws CoreException { return wizardElement.createWizard(); } };