Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Popup menu doesn't synch with E4 model
Popup menu doesn't synch with E4 model [message #1764673] Thu, 01 June 2017 10:33 Go to next message
Jacek Wicka is currently offline Jacek WickaFriend
Messages: 4
Registered: June 2014
Junior Member
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 08:33 Go to previous message
Jacek Wicka is currently offline Jacek WickaFriend
Messages: 4
Registered: June 2014
Junior Member
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.
Previous Topic:Problems setting up Linux RCP APP with existing code from Windows eclipse platform
Next Topic:Saving Data Stored In Editorpart in RCP application
Goto Forum:
  


Current Time: Sat Nov 17 04:37:18 GMT 2018

Powered by FUDForum. Page generated in 0.01285 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top