/** * 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()]); }
/** * 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()]); }
/** * Selects the wizard category and wizard in this page that were selected * last time this page was used. If a category or wizard that was * previously selected no longer exists then it is ignored. */ protected void selectPreviouslySelected(String setting, IWizardCategory wizardCategories, final TreeViewer viewer) { String selectedId = getDialogSettings().get(setting); if (selectedId == null) { return; } if (wizardCategories == null) { return; } Object selected = wizardCategories.findCategory(new Path( selectedId)); if (selected == null) { selected = wizardCategories.findWizard(selectedId); if (selected == null) { // if we cant find either a category or a wizard, abort. return; } } viewer.setSelection(new StructuredSelection(selected), true); }
/** * Selects the wizard category and wizard in this page that were selected last time this page was used. If a * category or wizard that was previously selected no longer exists then it is ignored. */ protected void selectPreviouslySelected() { String selectedId = settings.get(STORE_SELECTED_ID); if (selectedId == null) { return; } if (wizardCategories == null) { return; } Object selected = wizardCategories.findCategory(new Path(selectedId)); if (selected == null) { selected = wizardCategories.findWizard(selectedId); if (selected == null) { // if we cant find either a category or a wizard, abort. return; } } //work around for 62039 final StructuredSelection selection = new StructuredSelection(selected); filteredTree.getViewer().getControl().getDisplay().asyncExec(new Runnable() { public void run() { filteredTree.getViewer().setSelection(selection, true); } }); }
/** * Selects the wizard category and wizard in this page that were selected * last time this page was used. If a category or wizard that was * previously selected no longer exists then it is ignored. */ protected void selectPreviouslySelected() { String selectedId = settings.get(STORE_SELECTED_ID); if (selectedId == null) { return; } if (wizardCategories == null) { return; } Object selected = wizardCategories.findCategory(new Path( selectedId)); if (selected == null) { selected = wizardCategories.findWizard(selectedId); if (selected == null) { // if we cant find either a category or a wizard, abort. return; } } //work around for 62039 final StructuredSelection selection = new StructuredSelection(selected); filteredTree.getViewer().getControl().getDisplay().asyncExec(() -> filteredTree.getViewer().setSelection(selection, true)); }