@Override public Map getParameterValues() { final Map values = new HashMap(); final IWizardRegistry wizardRegistry = getWizardRegistry(); addParameterValues(values, wizardRegistry.getRootCategory()); return values; }
@Override public QuickAccessElement[] getElements() { if (cachedElements == null) { IWizardCategory rootCategory = WorkbenchPlugin.getDefault() .getNewWizardRegistry().getRootCategory(); List<IWizardDescriptor> result = new ArrayList<>(); collectWizards(rootCategory, result); IWizardDescriptor[] wizards = result .toArray(new IWizardDescriptor[result.size()]); for (int i = 0; i < wizards.length; i++) { if (!WorkbenchActivityHelper.filterItem(wizards[i])) { WizardElement wizardElement = new WizardElement(wizards[i], this); idToElement.put(wizardElement.getId(), wizardElement); } } cachedElements = idToElement.values().toArray( new QuickAccessElement[idToElement.size()]); } return cachedElements; }
/** * Returns the import wizards that are available for invocation. */ protected AdaptableList getAvailableImportWizards() { // TODO: imports are still flat - we need to get at the flat list. All // wizards will be in the "other" category. IWizardCategory root = WorkbenchPlugin.getDefault() .getImportWizardRegistry().getRootCategory(); WizardCollectionElement otherCategory = (WizardCollectionElement) root .findCategory(new Path( WizardsRegistryReader.UNCATEGORIZED_WIZARD_CATEGORY)); if (otherCategory == null) { return new AdaptableList(); } return otherCategory.getWizardAdaptableList(); }
/** * Returns the export wizards that are available for invocation. */ protected AdaptableList getAvailableExportWizards() { // TODO: exports are still flat - we need to get at the flat list. All // wizards will be in the "other" category. IWizardCategory root = WorkbenchPlugin.getDefault() .getExportWizardRegistry().getRootCategory(); WizardCollectionElement otherCategory = (WizardCollectionElement) root .findCategory(new Path( WizardsRegistryReader.UNCATEGORIZED_WIZARD_CATEGORY)); if (otherCategory == null) { return new AdaptableList(); } return otherCategory.getWizardAdaptableList(); }
/** * Create the wizard pages */ @Override public void addPages() { IWizardCategory root = WorkbenchPlugin.getDefault().getNewWizardRegistry().getRootCategory(); IWizardDescriptor [] primary = WorkbenchPlugin.getDefault().getNewWizardRegistry().getPrimaryWizards(); if (categoryId != null) { IWizardCategory categories = root; StringTokenizer familyTokenizer = new StringTokenizer(categoryId, CATEGORY_SEPARATOR); while (familyTokenizer.hasMoreElements()) { categories = getChildWithID(categories, familyTokenizer .nextToken()); if (categories == null) { break; } } if (categories != null) { root = categories; } } mainPage = new NewWizardSelectionPage(workbench, selection, root, primary, projectsOnly); addPage(mainPage); }
private void initializeNewWizardsMenu(DisplayItem menu) { Category rootForNewWizards = new Category( WorkbenchMessages.ActionSetDialogInput_wizardCategory); shortcuts.addChild(rootForNewWizards); IWizardCategory wizardCollection = WorkbenchPlugin.getDefault() .getNewWizardRegistry().getRootCategory(); IWizardCategory[] wizardCategories = wizardCollection.getCategories(); List<String> activeIDs = Arrays.asList(perspective.getNewWizardShortcuts()); for (IWizardCategory element : wizardCategories) { if (WorkbenchActivityHelper.filterItem(element)) { continue; } initializeNewWizardsMenu(menu, rootForNewWizards, element, activeIDs); } }
@Override protected void restoreWidgetValues(){ IWizardCategory importRoot = WorkbenchPlugin.getDefault().getImportWizardRegistry().getRootCategory(); expandPreviouslyExpandedCategories(STORE_EXPANDED_IMPORT_CATEGORIES, importRoot,importTree.getViewer()); selectPreviouslySelected(STORE_SELECTED_IMPORT_WIZARD_ID, importRoot, importTree.getViewer()); super.restoreWidgetValues(); }
@Override protected void restoreWidgetValues(){ IWizardCategory exportRoot = WorkbenchPlugin.getDefault().getExportWizardRegistry().getRootCategory(); expandPreviouslyExpandedCategories(STORE_EXPANDED_EXPORT_CATEGORIES, exportRoot, exportTree.getViewer()); selectPreviouslySelected(STORE_SELECTED_EXPORT_WIZARD_ID, exportRoot, exportTree.getViewer()); super.restoreWidgetValues(); }
@Override protected Composite createTreeViewer(Composite parent) { IWizardCategory root = WorkbenchPlugin.getDefault() .getImportWizardRegistry().getRootCategory(); importTree = new CategorizedWizardSelectionTree( root, WorkbenchMessages.ImportWizard_selectWizard); Composite importComp = importTree.createControl(parent); importTree.getViewer().addSelectionChangedListener(event -> listSelectionChanged(event.getSelection())); importTree.getViewer().addDoubleClickListener(event -> treeDoubleClicked(event)); setTreeViewer(importTree.getViewer()); return importComp; }
@Override protected Composite createTreeViewer(Composite parent) { IWizardCategory root = WorkbenchPlugin.getDefault() .getExportWizardRegistry().getRootCategory(); exportTree = new CategorizedWizardSelectionTree( root, WorkbenchMessages.ExportWizard_selectWizard); Composite exportComp = exportTree.createControl(parent); exportTree.getViewer().addSelectionChangedListener(event -> listSelectionChanged(event.getSelection())); exportTree.getViewer().addDoubleClickListener(event -> treeDoubleClicked(event)); setTreeViewer(exportTree.getViewer()); return exportComp; }