Bug 276737 - [Contributions] Regression: No longer possible to update a menu from background using IMenuCreator
Summary: [Contributions] Regression: No longer possible to update a menu from backgrou...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4.2   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-18 11:35 EDT by Benjamin Pasero CLA
Modified: 2019-09-06 16:10 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Pasero CLA 2009-05-18 11:35:53 EDT
We have an Action as AS_DROP_DOWN_MENU that implements IMenuCreator and is used to create a submenu for a popup menu (Entry 3). The submenu first shows "Loading..." to resolve its entries and then populates the entries from the background:

Entry 1
Entry 2
Entry 3 > Loading...
Entry 4

This worked in 3.3 and is now broken in > 3.4.2

It seems, ActionContributionItem introduced the notion of proxys for menus. I can see that ActionContributionItem.handleShowProxy(Menu) is called when I move my mouse over the menu item "Entry 3" and "Loading..." is properly showing. However, the additional items that get created from the background are never showing up in the sub menu as long as I dont move my mouse to a different item and back to the "Entry 3". Looking at the code, I can see that the items from the menu I create from IMenuCreator are filled into a proxy and then displayed. Thus, I can not create additional entries from the background because I dont have any menu to fill them into (only the one I created initially, but thats not used at all).

Whats the way to go in 3.4 and 3.5 to lazy fill entries into a popup menu?
Comment 1 Paul Webster CLA 2009-05-19 09:14:43 EDT
sigh.

This is a side effect of the fix for bug 136397 and bug 189092

Until the proxy disappears for the first time (and the real menu gets swapped in) the proxy will only show the "first" fill in of the real menu.

PW
Comment 2 Paul Webster CLA 2009-05-19 09:22:18 EDT
Dynamically updating a showing popup, using MenuManager instead of IMenuCreator.  This is a "general shape" example:

MenuManager popup = new MenuManager();
popup.add(new Action("Hello") { });
popup.add(new Action("Hi") { });
final MenuManager toFill = new MenuManager("To Fill");
toFill.add(new Action("Loading...") { });
toFill.addMenuListener(new IMenuListener() {
  public void menuAboutToShow(IMenuManager manager) {
    display.timerExec(5000, new Runnable() {
      public void run() {
        toFill.removeAll();
        toFill.add(new Action("Added one") { });
        toFill.add(new Action("Added two") { });
        toFill.add(new Action("Added three") { });
        toFill.update(true);
      } });
  }
});
popup.add(toFill);
popup.add(new Action("Howdy") { });
Comment 3 Eclipse Webmaster CLA 2019-09-06 16:10:51 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.