private void collectWizards(IWizardCategory category, List<IWizardDescriptor> result) { result.addAll(Arrays.asList(category.getWizards())); for (IWizardCategory childCategory : category.getCategories()) { collectWizards(childCategory, result); } }
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 category the wizard category * @return whether all of the wizards in the category are enabled via activity filtering */ private boolean allActivityEnabled(IWizardCategory category) { for (IWizardDescriptor wizard : category.getWizards()) { if (WorkbenchActivityHelper.filterItem(wizard)) { return false; } } for (IWizardCategory wizard : category.getCategories()) { if (!allActivityEnabled(wizard)) { return false; } } return true; }
/** * @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; }
/** * @param category * the wizard category * @return whether all of the wizards in the category are enabled via activity filtering */ private boolean allActivityEnabled(IWizardCategory category) { IWizardDescriptor[] wizards = category.getWizards(); for (IWizardDescriptor wizard : wizards) { if (WorkbenchActivityHelper.filterItem(wizard)) { return false; } } IWizardCategory[] children = category.getCategories(); for (int i = 0; i < children.length; i++) { if (!allActivityEnabled(children[i])) { return false; } } return true; }
private boolean hasWizards(IWizardCategory category) { IWizardDescriptor[] wizards = category.getWizards(); if (wizards.length>0) { for (int i = 0; i < wizards.length; i++) { if (!WorkbenchActivityHelper.filterItem(wizards[i])) { return true; } } } IWizardCategory[] categories = category.getCategories(); for (int i = 0; i < categories.length; i++) { if (hasWizards(categories[i])) { return true; } } return false; }
/** * @param category * the wizard category * @return whether all wizards in the category are considered primary */ private boolean allPrimary(IWizardCategory category) { IWizardDescriptor[] wizards = category.getWizards(); for (IWizardDescriptor wizard2 : wizards) { IWizardDescriptor wizard = wizard2; if (!isPrimary(wizard)) { return false; } } IWizardCategory[] children = category.getCategories(); for (int i = 0; i < children.length; i++) { if (!allPrimary(children[i])) { return false; } } return true; }
jbpmWizardCategory = category; for(IWizardDescriptor wizard : category.getWizards()) { if (BPMN2_MODELER_JBPM_WIZARD.equals(wizard.getId())) { bpmn2ModelerWizard = wizard; for(IWizardDescriptor wizard : category.getWizards()) { for (String id : wizardIdsToRemove) { if (id.equals(wizard.getId())) {
private void initializeNewWizardsMenu(DisplayItem menu, Category parentCategory, IWizardCategory element, List<String> activeIds) { Category category = new Category(element.getLabel()); parentCategory.addChild(category); Object[] wizards = element.getWizards(); for (Object wizard2 : wizards) { WorkbenchWizardElement wizard = (WorkbenchWizardElement) wizard2; ShortcutItem item = new ShortcutItem(wizard.getLabel(), wizard); item.setLabel(wizard.getLabel()); item.setDescription(wizard.getDescription()); if (wizard.getImageDescriptor() != null) { item.setImageDescriptor(wizard.getImageDescriptor()); } item.setCheckState(activeIds.contains(wizard.getId())); menu.addChild(item); category.addShortcutItem(item); } // @issue should not pass in null for (IWizardCategory child : element.getCategories()) { initializeNewWizardsMenu(menu, category, child, activeIds); } }