Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » EModelService doesn't find the menu item
EModelService doesn't find the menu item [message #1700700] Mon, 06 July 2015 14:27 Go to next message
Loic Faure is currently offline Loic FaureFriend
Messages: 24
Registered: December 2014
Junior Member
Hi,

Maybe I'm doing it wrong, but I cannot retreive menu items from the EModelService.
I'm using Mars (4.5) with Build id: I20150528-0700

The code I used is : List<MHandledMenuItem> itemsMenu = modelService.findElements(app, null, MHandledMenuItem.class, null);

This is correct with the MHandledToolItem, in this case the method returns all the tool item. But with MHandledMenuItem I get 0 item.

Am I doing it wrong ? Or this is a bug ?

Thanks
Re: EModelService doesn't find the menu item [message #1700908 is a reply to message #1700700] Wed, 08 July 2015 06:58 Go to previous messageGo to next message
Loic Faure is currently offline Loic FaureFriend
Messages: 24
Registered: December 2014
Junior Member
Contrary to what it seems to be, the constant EModelService.ANYWHERE doesn't search anywhere so I added EModelService.IN_MAIN_MENU to EModelService.ANYWHERE which give the line below
List<MHandledItem> items = modelService.findElements(app, null, MHandledItem.class, tags, EModelService.ANYWHERE | EModelService.IN_MAIN_MENU);
So, now it search anywhere
Re: EModelService doesn't find the menu item [message #1751112 is a reply to message #1700908] Wed, 04 January 2017 14:50 Go to previous message
Piero Campalani is currently offline Piero CampalaniFriend
Messages: 114
Registered: January 2015
Senior Member

Thanks Loic, that was useful!

I had a similar issue while looking for a MDirectMenuItem, and I also had to add the EModelService.IN_PART to the findElements() call.
Previous Topic:CycleViewHandler with E4 Parts & E3 Editors in the EditorArea
Next Topic:How to get Application Model updated when making a project copy?
Goto Forum:
  


Current Time: Sat Apr 20 01:03:39 GMT 2024

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

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

Back to the top