|Re: How to find DirectMenuItem programmatically [message #946852 is a reply to message #946827]
||Tue, 16 October 2012 15:09
| François POYER
Registered: December 2009
I think that this is because EModelService#find() only search through composition relation like MUIElementContainer#children, which does not include the MWindow#mainMenu relation and such.|
You may want to do this in 2 steps: use find(id, root) to find the "container" of your Menu (here: the MTrimmedWindow) by its ID (or any other mean convenient to you), then call find(id, root) again, but using the menu as the search root this time.
MTrimmedWindow trim = modelService.find("myWindow", application).get(0);
MDirectMenuItem item = (MDirectMenuItem)modelService.find("myItem", trim.getMainMenu());
Hope this helps!
Edit: Ok, very, very late... nevermind me!
[Updated on: Tue, 16 October 2012 15:10]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.09373 seconds