Community
Participate
Working Groups
From RH: IMenuCreator is hard to use and is improperly used. I am suprised at how different and inconsistent it is to drop-down a menu from an Action in the Toolbar. For Menus, it is so easy. I just take a MenuManager and add it to another MenuManager. What could be easier? I would deprecate all of this stuff: 1) IAction#AS_DROP_DOWN_MENU - this doesn't even make sense if the Action is in a menu. A cascading menu cannot be selected. This style is Toolbar specific. 2) IMenuCreator - too difficult to implement. Alternative proprosed below. JFace should provide a ToolbarDropDownMenuManager, which is very similar to a MenuManager, but it knows how to fill a Toolbar properly. I just new one, and add it to a ToolbarManager. This class should *optionally* take an IAction that would be associated with clicking on the ToolItem. For example, the NewDropDown will open the new dialog if you click on it. But what if I have no default action, and I *ALWAYS* want to drop-down the menu. This is currently very hard to do as well. It requires copying code.
Related bug report [Bug 25837] IMenuCreator.dispose() is never called.
------- Additional Comment #8 From Joseph Khalil 2002-11-10 03:11 ------- I have an opinion in IMenuCreator... i really hate it coz the problem is solved in MenuManager by adding a MenuManager to another MenuManager so we can get the DROP_DOWN menu.. we can make a similar solution for a toolbar by making some modification in MenuManager Since a MenuManager is a IContributionItem we can make the MenuManager takes an IAction in its constructor. so the Text is taken directly from the IAction instead of the text taken in its constructor now.. also the image can be taken from the IAction so the sub menu can have image not text only as now.. note that the run() method of IAction is ignored in the sub menu case.. now what about toolBar case.. when you want to add a toolItem with DROP_DOWN menu , you add a MenuManager with it's IAction , so the image is taken from the IAction, when you click on it the run() method runs , when you click the arrow the MenuManager shows its menu (that contains the MenuManager child IContribution Items ) I guess this will be enough and consistent...
There are no plans for the UI team to work on this defect until higher priority items are addressed. If you are interested in working on this defect please let us know on the platform-ui-dev mailing list.
There are currently no plans to work on this feature