Bug 25910 - [JFace] Introduce ToolBarDropDownMenuManager
Summary: [JFace] Introduce ToolBarDropDownMenuManager
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P4 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2002-11-08 14:02 EST by Lynne Kues CLA
Modified: 2006-06-22 08:35 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lynne Kues CLA 2002-11-08 14:02:18 EST
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.
Comment 1 Lynne Kues CLA 2002-11-08 14:02:55 EST
Related bug report [Bug 25837] IMenuCreator.dispose() is never called.
Comment 2 Lynne Kues CLA 2002-11-11 10:09:08 EST
------- 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...

Comment 3 Nick Edgar CLA 2003-02-10 10:26:59 EST
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.
Comment 4 Tod Creasey CLA 2006-06-22 08:35:02 EDT
There are currently no plans to work on this feature