Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » superseding existing label/content providers in the common navigator framework
superseding existing label/content providers in the common navigator framework [message #333749] Wed, 31 December 2008 18:33 Go to next message
Bob Frankel is currently offline Bob FrankelFriend
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
Francis Upton IV is currently offline Francis Upton IVFriend
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


Previous Topic:[CommonNavigator] Request for community input on label provider issue
Next Topic:Common Navigator DND
Goto Forum:
  


Current Time: Thu Dec 26 17:26:39 GMT 2024

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

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

Back to the top