| Summary: | [Contributions] (dynamic) Support for showing and hiding dynamic menus | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Dan Rubel <danrubel> |
| Component: | UI | Assignee: | Paul Webster <pwebster> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | clayberg, pickens, tim_koss |
| Version: | 2.1 | Keywords: | api |
| Target Milestone: | 3.3 | ||
| Hardware: | Other | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
| Bug Depends on: | 29709 | ||
| Bug Blocks: | 97356 | ||
|
Description
Dan Rubel
I have changed the title to more accurately describe the needed enhancement. I have the following concern with the proposed patch. On the surface, this seems like an innocent request. However, giving arbitrary plug-ins access to the real menubar is not a good idea. Currently editors and views are given a virtual menubar, which allows the workbench to manage placement and visibility of menu items appropriately based on part activation. Likewise for action sets and how they are managed (globally on, or associated with perspective or part). Giving arbitrary access to the real menubar would preempt the ability of the workbench to manage actions consistently, and could lead to an unpredictable UI. For example, regular plug-ins would not only be able to add menus and menu items independently of a particular perspective or part, but would also be able to remove and modify actions from other plug-ins. Have you tried using the existing API for dynamic menus and/or drop-down toolbar items (a la Run and Debug actions)? See IWorkbenchWindowPulldownDelegate and the pulldown=true attribute on action elements in the actionSets extension point. The current mechanism has the limitation of only being able to add dynamic submenus or dynamic tool items, not dynamic top-level menus, and there is currently no way of programmatically showing and hiding action sets (see bug 39455 for my concerns with adding the latter). However, we may be able to extend the existing mechanism to meet your needs. From your description above, it sounds like you need: 1. The ability to define a new top-level menu. 2. The ability to dynamically add or remove items from the menu. 3. The ability to programmatically hide or show the top-level menu in response to a user request. Questions: - Does the menu appear globally, or is at associated with particular perspectives? - If the user turns it off, is it removed from all windows and all perspectives, or just the current window and perspective? - What is the UI for turning the menu on and off? Is it a user preference or some other mechanism? I also need to be able to generate a menu on the main menubar whose contents isn't known until runtime. I know that this is possible for submenus via the IWorkbenchWindowPulldownDelegate2 interface, but couldn't you extend this mechanism for top-level menus? Reassigning bugs in component areas that are changing ownership. Moving Dougs bugs Assigning to component owner PW This has been fixed and/or superceded by the menu contribution work - bug 154130 PW |