|Dynamically Contribute to Context Menu [message #1064319]
||Tue, 18 June 2013 12:39
| Jacob M
Registered: June 2013
Does anyone know how I can modify the right-click menu from the action of another context menu? I want to have one button configured from plugin.xml that can, from its IAction, change that context menu's layout. For example, a button "Generate Buttons" will change the menu by adding another button "myNewButton".
Here's my existing attempt. I feel I'm close, but 1) .createContextMenu() takes a "Control" - I've never explicitly created a Control so I don't think I've one I can reference, and 2) I don't even know if CreateContextMenu() is something I should use or if there's a better way (I've seen references to "Contributions" but have only used them for menu bar items, never the right-click menu).
MenuManager contextMenu = new MenuManager("#PopUp");
Menu menu = contextMenu.createContextMenu(null);
I've looked hard for tutorials or explanations on this but have been unable to find a suitable answer. I'm looking for any explanation, though I'd learn best from seeing actual code.
Powered by FUDForum
. Page generated in 0.02397 seconds