Popup menu doesn't synch with E4 model [message #1764673] |
Thu, 01 June 2017 06:33  |
Eclipse User |
|
|
|
In pure E4 RCP, I am creating a popup menu for given widget like this:
MPopupMenu menuModel = findMenuModel(id); //look up in window-sharedElements
MPopupMenu model = (MPopupMenu)modelService.cloneElement(menuModel, null);
Menu menu = (Menu)engine.createGui(model, widget, context);
widget.setMenu(menu);
The original model is defined under window-sharedElements.
Menu shows up but it is not synched with the model correctly.
I found out, that no ENotification is send when the corresponding property is set (f.e. MMenuItem#setEnabled()), thus the event handler in MenuManagerRenderer isn't triggered.
Did I missed something?
|
|
|
Re: Popup menu doesn't synch with E4 model [message #1765171 is a reply to message #1764673] |
Wed, 07 June 2017 04:33  |
Eclipse User |
|
|
|
Added the model to current MPart:
MPopupMenu menuModel = findMenuModel(id); //look up in window-sharedElements
MPopupMenu model = (MPopupMenu)modelService.cloneElement(menuModel, null);
--> currentPart.getMenus().add(model);
Menu menu = (Menu)engine.createGui(model, widget, context);
widget.setMenu(menu);
Seems to work now.
|
|
|
Powered by
FUDForum. Page generated in 0.37061 seconds