Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Correct use EModelService.findElements?
Correct use EModelService.findElements? [message #734179] Thu, 06 October 2011 19:43 Go to next message
Missing name Missing name is currently offline Missing name Missing name
Messages: 18
Registered: September 2011
Junior Member
I must be misunderstanding something basic about how to properly use EModelService.

I'm trying to find a menu in my model from within a handler. I can find it by traversing the model down from the application, but findElements says the menu doesn't exist. Here's my code:

assert "view" == ((MTrimmedWindow)application.getChildren().get(0)).getChildren().get(1).getElementId();
assert modelService.findElements(application, "view", null, null).isEmpty();

The first method works. My model has a trimmed window with a main menu with two menus. I'm trying to get the second one with id "view".
The second method fails. I've also tried searching by class.
Obviously I'm doing something wrong but I can't see what.
Re: Correct use EModelService.findElements? [message #736547 is a reply to message #734179] Fri, 14 October 2011 01:10 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing name
Messages: 18
Registered: September 2011
Junior Member
Looking at the source of ModelServiceImpl I determined that findElements doesn't look at menus. It looks at the children and windows and trim windows, but ignores menus. Is there some other way of finding a menuitem in the model by id short of writing my own code to search through the model?
Re: Correct use EModelService.findElements? [message #736594 is a reply to message #736547] Fri, 14 October 2011 02:26 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5257
Registered: July 2009
Senior Member
This is a bug IMHO.

Tom

Am 14.10.11 07:10, schrieb grillo321:
> Looking at the source of ModelServiceImpl I determined that findElements
> doesn't look at menus. It looks at the children and windows and trim
> windows, but ignores menus. Is there some other way of finding a
> menuitem in the model by id short of writing my own code to search
> through the model?
>
Previous Topic:How to contribute to an E3 perspective with E4 Part.
Next Topic:Dropdown in Toolbar
Goto Forum:
  


Current Time: Thu Jul 31 01:30:29 EDT 2014

Powered by FUDForum. Page generated in 0.01831 seconds