类org.eclipse.ui.wizards.IWizardCategory源码实例Demo

下面列出了怎么用org.eclipse.ui.wizards.IWizardCategory的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: gama   文件: CleanupHelper.java
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 项目: gama   文件: CleanupHelper.java
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]);
}
 
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 项目: translationstudio8   文件: NewActionProvider.java
/**
 * 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;

}
 
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 项目: tmxeditor8   文件: NewActionProvider.java
/**
 * 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;

}
 
 类所在包
 同包方法