Project: Eclipse_Platform_UI
Bug 129841 [DynamicUI] Calling reg.removeExtension, then reg.addContribution not showing actionSet in UI
Reported: 2006-02-28 14:49:36 | Status: verified fixed

I'm using the new dynamic registry APIs in 3.2 M5 (thanks!). The problem is that I'm adding a dynamic extension (reg.addContribution), then removing it using reg.removeExtension, and then not seeing it in the UI when I try to re-add the same one again. There are no exception being thrown, and the registry is indeed allowing me to re-add (reg.addContribution), but in my case, I'm adding actionSets and they never appear in the UI. I added a registry listener and it is fired when I do the re-add, but the UI does not get refreshed. Interesting, is that if open a new workbench window and I do see the updated UI! here is my addContribution code: void addExtension() { IExtensionRegistry reg = RegistryFactory.getRegistry(); IContributor contributor = ContributorFactorySimple.createContributor("test.dynamic.extensions"); String xmlsrc = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><plugin><extension id=\"extensionId1\" point=\"org.eclipse.ui.actionSets\"><actionSet label=\"Sample Action Set\" visible=\"true\" id=\"test.dynamic.extensions.SampleactionSet\"><menu label=\"Dynamic Extension\" id=\"sampleMenu\"><separator name=\"sampleGroup\"></separator></menu><action label=\"Sample Extension\" icon=\"icons/blue.gif\" class=\"test.dynamic.extensions.actions.SampleAction\" tooltip=\"Sample Extension\" menubarPath=\"sampleMenu/sampleGroup\" toolbarPath=\"sampleGroup\" id=\"test.dynamic.extensions.actions.SampleAction\"></action></actionSet></extension></plugin>"; ByteArrayInputStream is = new ByteArrayInputStream(xmlsrc.getBytes()); reg.addContribution(is, contributor, false, null, null, null); } And here is my removeExtension code: void removeExtension() { IExtensionRegistry reg = RegistryFactory.getRegistry(); IExtension extension = reg.getExtension("org.eclipse.ui.actionSets", "test.dynamic.extensions.extensionId1"); reg.removeExtension(extension,null); }

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/ActionSetTests.java tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicPluginsTestSuite.java