Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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: Sun Jul 06 17:13:28 EDT 2025

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

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

Back to the top