Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] MenuManager modification to get rid of IMenuCreator

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 and id is taken directly from the IAction instead of the text
and id 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...


Back to the top