Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » Toolbar Contribution(Can't get toolbar contribution over model service)
Toolbar Contribution [message #782099] Mon, 23 January 2012 01:29 Go to next message
Eclipse UserFriend
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 16:21 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Toolbar Contribution [message #783656 is a reply to message #783510] Thu, 26 January 2012 02:16 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 18:08:56 EDT 2025

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

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

Back to the top