I'm working in a RCP application and I have a view which data model are instances of IResources. When popup menu is visible I find commands contributed by others plugins I would like to remove.
Sample of code:
1 MenuManager menuManager = new MenuManager(); 2 mm.setRemoveAllWhenShown(true); 3 Menu menu = menuManager.createContextMenu(this.treeViewer.getControl()); 4 this.treeViewer.getControl().setMenu(menu); 5 getSite().registerContextMenu(menuManager, this.treeViewer);
If I comment line 5 context menu doesn't appear.
Is posible use menu-contribution from plugin.xml and remove contributions of other plugins?
Note: My popup menu is declarative and it is in plugin.xml.
Thanks in advance
A possible way is to exeucte so called "Equinox transformer hooks", see http://wiki.eclipse.org/Equinox_Transforms
You can checkout the bundles with some examples (see the wiki-page for more infos), I made good experiences with the XSLT transformer, to manipulate certain plugin.xml files before they're contributing their extensions to the platform (the only challenge is to find out which bundle is contributing the annoying context-menu entry, but you can use PluginSpy to determinate the "evildoer" :-P.
HTH Tom
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With