superseding existing label/content providers in the common navigator framework [message #333749] |
Wed, 31 December 2008 18:33 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Bob Frankel![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=bios.bob.frankel%40gmail.com) Messages: 12 Registered: July 2009 |
Junior Member |
|
|
This question was posted over a year ago on this newsgroup, and
apparently there was no response. I'm in a similar situation and am
looking for help here....
I'd like to add custom support for *.abc files to the standard Project
Explorer view (that's based on the Common Navigator framework). This
includes custom icons based on file content, but also additional actions
and drop adapters etc. The problem is that the *.abc files, since they
are files, are already provided by org.eclipse.ui.navigator.resources'
navigatorContent extension (org.eclipse.ui.navigator.resourceContent). I
was hoping that if my own navigatorContent extension was set to a higher
priority, the *.abc files would be provided by my navigatorContent
instead, and therefore its label provider etc. would be used. However,
instead I see org.eclipse.ui.navigator.resourceContent's label provider
being invoked, followed a couple of seconds later by my
navigatorContent's. I suspect I may be going about this all wrong, as
I'm not very familiar with the Common Navigator framework. Basically, is
there a way of restricting the output from an existing
navigatorContent's contentProvider, or maybe some completely different
way of getting this to work (ideally by "extending" rather than
replacing the Project Explorer view)?
Asked another way, how does the 'Java Elements' content provider in the
Project Explorer effectively supersede the 'Resources' content provider
for a given java project.... i'm doing some similar in my own
label/content providers, but find i have to *explicitly* disable the
'Resources' content provider to basically get it to ignore my specific
sort of project.
Thanks.
|
|
|
Re: superseding existing label/content providers in the common navigator framework [message #334012 is a reply to message #333749] |
Thu, 15 January 2009 19:23 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Francis Upton IV![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=francisu%40ieee.org) Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
Look at the override element in the navigatorContent extension point,
that will get you the right content provider (you want to override the
content providers in the org.eclipse.ui.navigator.resources plugin).
And use the enablement expression in your navigatorContent extension
point, so in most cases it will also get you the same label provider.
See also this (mainly for some background):
http://dev.eclipse.org/blogs/francis/2009/01/15/community-co mments-needed-for-common-navigator-label-providers/
Francis
Bob Frankel wrote:
> This question was posted over a year ago on this newsgroup, and
> apparently there was no response. I'm in a similar situation and am
> looking for help here....
>
> I'd like to add custom support for *.abc files to the standard Project
> Explorer view (that's based on the Common Navigator framework). This
> includes custom icons based on file content, but also additional actions
> and drop adapters etc. The problem is that the *.abc files, since they
> are files, are already provided by org.eclipse.ui.navigator.resources'
> navigatorContent extension (org.eclipse.ui.navigator.resourceContent). I
> was hoping that if my own navigatorContent extension was set to a higher
> priority, the *.abc files would be provided by my navigatorContent
> instead, and therefore its label provider etc. would be used. However,
> instead I see org.eclipse.ui.navigator.resourceContent's label provider
> being invoked, followed a couple of seconds later by my
> navigatorContent's. I suspect I may be going about this all wrong, as
> I'm not very familiar with the Common Navigator framework. Basically, is
> there a way of restricting the output from an existing
> navigatorContent's contentProvider, or maybe some completely different
> way of getting this to work (ideally by "extending" rather than
> replacing the Project Explorer view)?
>
> Asked another way, how does the 'Java Elements' content provider in the
> Project Explorer effectively supersede the 'Resources' content provider
> for a given java project.... i'm doing some similar in my own
> label/content providers, but find i have to *explicitly* disable the
> 'Resources' content provider to basically get it to ignore my specific
> sort of project.
>
> Thanks.
--
*new* Common Navigator Framework section in:
3.4RC4 Platform Plugin Developer Guide (Programmer's Guide)
http://help.eclipse.org/ganymede/topic/org.eclipse.platform. doc.isv/guide/cnf.htm
http://dev.eclipse.org/blogs/francis
http://wiki.eclipse.org/Common_Navigator_Framework
http://wiki.eclipse.org/Common_Navigator_Framework_Use_Cases
You have brains in your head.
You have feet in your shoes.
- Dr Seuss, Oh the Places You'll Go
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
|
Powered by
FUDForum. Page generated in 0.03540 seconds