private final String excludedWizards = "org\\.eclipse\\.ui\\.wizards\\.(import|export)\\.(?!Preferences).*";
AbstractExtensionWizardRegistry wizardRegistry = (AbstractExtensionWizardRegistry)WorkbenchPlugin.getDefault().getNewWizardRegistry();
IWizardCategory[] categories = WorkbenchPlugin.getDefault().getNewWizardRegistry().getRootCategory().getCategories();
for(IWizardDescriptor wizard : getAllWizards(categories)){
if(wizard.getId().matches(excludedWizards)){
WorkbenchWizardElement wizardElement = (WorkbenchWizardElement) wizard;
wizardRegistry.removeExtension(wizardElement.getConfigurationElement().getDeclaringExtension(), new Object[]{wizardElement});
}
}
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]);
}
]]>