Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Toolbar Contribution(Can't get toolbar contribution over model service)
Toolbar Contribution [message #782099] Mon, 23 January 2012 06:29 Go to next message
Beat Schaller is currently offline Beat SchallerFriend
Messages: 42
Registered: July 2009
Member
I am trying to get a toolbar contribution over the model service. The id is defined in the Application.e4xmi. An handled item is also defined. The part let inject the MApplication and the EModelService.

But when I try to get the contribution or the item I get always null.

final MUIElement contribution = modelService.find("toolbar-contribution-id", application);
final MUIElement item = modelService.find("toolbar-contribution-item-id", application);


modelService and application are not null...

any hints?
Thx Beat
Re: Toolbar Contribution [message #783510 is a reply to message #782099] Wed, 25 January 2012 21:21 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 194
Registered: January 2012
Senior Member

EModelService's searches are pretty much restricted to looking at contained children. An MWindow or MPart's toolbar isn't actually considered to be a child of the element but an attribute. The comment is a bit confusing.

In my usage, I've usually wanted to get a tool item relative to either the active window's toolbar or the active part's toolbar, or the toolbar for a particular part, and so been able to avoid the recursive descent of EModelService#find() and friends.


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Re: Toolbar Contribution [message #783656 is a reply to message #783510] Thu, 26 January 2012 07:16 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5470
Registered: July 2009
Senior Member
Am 25.01.12 22:21, schrieb Brian de Alwis:
> EModelService's searches are pretty much restricted to looking at
> contained children. An MWindow or MPart's toolbar isn't actually
> considered to be a child of the element but an attribute. The comment
> is a bit confusing.
>
> In my usage, I've usually wanted to get a tool item relative to either
> the active window's toolbar or the active part's toolbar, or the toolbar
> for a particular part, and so been able to avoid the recursive descent
> of EModelService#find() and friends.

Well IMHO this is a bug in EModelService then. They should simply use an
TreeIterator to find all "children" of an element.

Tom
Previous Topic:problem with org.eclipse.ui.internal.MakeHandlersGo
Next Topic:Minimize CTabFolder at Runtime
Goto Forum:
  


Current Time: Sat Nov 29 07:56:24 GMT 2014

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

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