|
Dynamic Drop-Down Command in 3.3+ -
09-22-2008, 05:11 PM
Hey Everyone,
I'm in the process of converting a plug-in from the old actionSet extensions to the new commands. One of these commands acts like a dynamic pulldown menu on the toolbar (think of the run-button in the Eclipse IDE and how it adds and sorts by the most recently ran run configuration.) This was a little tricky to figure out using actions, but it turns out you implement IWorkbenchWindowPulldownDelegate which has a getMenu method.
Now as for the command version, I've set pulldown to true which will give me the drop-down look without the actual menu. I've tried implementing IElementUpdater and I was able to perform element.setDropDownId("testMenu"); which set the command to a pre-existing menu extension. This had several problems. One, it was only executed once updateElement() was called, two I couldn't get to this menu to add new items, and three I'm not sure if this is the right way to go about it.
If anyone knows the correct way to do this let me know. It seems like every example on the internet dictates a pull-down command that has a predefined (static) menu.
|