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 23:43 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
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 05:10 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
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 06:26 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6331
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:What's new in e4 2011?
Next Topic:how to set minimum size for windows or parts
Goto Forum:
  


Current Time: Fri Jul 28 13:23:49 GMT 2017

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

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