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: 110
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:Mars Version: Problems with Dynamic menu contribution
Next Topic:Command/keyboard binding to jump between split editor panes?
Goto Forum:
  


Current Time: Thu Sep 21 12:33:46 GMT 2017

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

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