Java源码示例:org.eclipse.ui.wizards.IWizardCategory

示例1
static void run() {
	final List<IWizardCategory> cats = new ArrayList<>();
	AbstractExtensionWizardRegistry r =
			(AbstractExtensionWizardRegistry) PlatformUI.getWorkbench().getNewWizardRegistry();
	cats.addAll(Arrays.asList(r.getRootCategory().getCategories()));
	r = (AbstractExtensionWizardRegistry) PlatformUI.getWorkbench().getImportWizardRegistry();
	cats.addAll(Arrays.asList(r.getRootCategory().getCategories()));
	r = (AbstractExtensionWizardRegistry) PlatformUI.getWorkbench().getExportWizardRegistry();
	cats.addAll(Arrays.asList(r.getRootCategory().getCategories()));
	for (final IWizardDescriptor wizard : getAllWizards(cats.toArray(new IWizardCategory[0]))) {
		final String id = wizard.getCategory().getId();
		if (CATEGORIES_TO_REMOVE.contains(id) || IDS_TO_REMOVE.contains(wizard.getId())) {
			// DEBUG.LOG("Removing wizard " + wizard.getId() +
			// " in category " + id);
			final WorkbenchWizardElement element = (WorkbenchWizardElement) wizard;
			r.removeExtension(element.getConfigurationElement().getDeclaringExtension(),
					new Object[] { element });
		}
	}

}
 
示例2
static private IWizardDescriptor[] getAllWizards(final IWizardCategory[] categories) {
	final List<IWizardDescriptor> results = new ArrayList<>();
	for (final IWizardCategory wizardCategory : categories) {

		results.addAll(Arrays.asList(wizardCategory.getWizards()));
		results.addAll(Arrays.asList(getAllWizards(wizardCategory.getCategories())));
	}
	return results.toArray(new IWizardDescriptor[0]);
}
 
示例3
private IWizardDescriptor[] getAllWizards(IWizardCategory... categories) {
	List<IWizardDescriptor> results = new ArrayList<IWizardDescriptor>();
	for (IWizardCategory wizardCategory : categories) {
		results.addAll(Arrays.asList(wizardCategory.getWizards()));
		results.addAll(Arrays.asList(getAllWizards(wizardCategory.getCategories())));
	}
	return results.toArray(new IWizardDescriptor[0]);
}
 
示例4
/**
 * Return whether or not any examples are in the current install.
 * 
 * @return True if there exists a full examples wizard category.
 */
private boolean hasExamples() {
	IWizardRegistry newRegistry = PlatformUI.getWorkbench().getNewWizardRegistry();
	IWizardCategory category = newRegistry.findCategory(FULL_EXAMPLES_WIZARD_CATEGORY);
	return category != null;

}
 
示例5
private IWizardDescriptor[] getAllWizards(IWizardCategory... categories) {
	List<IWizardDescriptor> results = new ArrayList<IWizardDescriptor>();
	for (IWizardCategory wizardCategory : categories) {
		results.addAll(Arrays.asList(wizardCategory.getWizards()));
		results.addAll(Arrays.asList(getAllWizards(wizardCategory.getCategories())));
	}
	return results.toArray(new IWizardDescriptor[0]);
}
 
示例6
/**
 * Return whether or not any examples are in the current install.
 * 
 * @return True if there exists a full examples wizard category.
 */
private boolean hasExamples() {
	IWizardRegistry newRegistry = PlatformUI.getWorkbench().getNewWizardRegistry();
	IWizardCategory category = newRegistry.findCategory(FULL_EXAMPLES_WIZARD_CATEGORY);
	return category != null;

}