Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Add java element decoration to a common navigator(Add java element decoration to a common navigator)
Add java element decoration to a common navigator [message #641380] Thu, 25 November 2010 09:17 Go to next message
Alain Artouste is currently offline Alain ArtousteFriend
Messages: 17
Registered: October 2010
Junior Member
Hello,

I have created a common navigator to display resources (Projects, Folders, Files) on my own arrangement, with customized label and content providers.

Nevertheless, I would like to subscribe to marker service on resources when error are encountered (an error decorator is added on Java file, folder and project image when error occurs on a java class file).

Is there a way to use jdt processing or must I develop this part?

Thanks for any help

Alain
Re: Add java element decoration to a common navigator [message #641419 is a reply to message #641380] Thu, 25 November 2010 11:16 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Alain Artouste wrote:
> Hello,
>
> I have created a common navigator to display resources (Projects,
> Folders, Files) on my own arrangement, with customized label and
> content providers.
Why do you create your own common navigator?
>
> Nevertheless, I would like to subscribe to marker service on resources
> when error are encountered (an error decorator is added on Java file,
> folder and project image when error occurs on a java class file).
>
> Is there a way to use jdt processing or must I develop this part?
If you really create your own common navigator then you also have to
provide the label provider to Java projects yourself. You can start by
looking at org.eclipse.jdt.internal.ui.navigator.JavaNavigatorLabelProv ider.

Dani
>
> Thanks for any help
>
> Alain
>
Re: Add java element decoration to a common navigator [message #641496 is a reply to message #641419] Thu, 25 November 2010 17:02 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IVFriend
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
To elaborate on Dani's question about why are you creating your own CommonNavigator:

1) Could you use the ProjectExplorer (which has all of the resource stuff built into it)? This is simply using the org.eclipse.ui.navigator.resources plugin.

2) If you don't like some of the things the ProjectExplorer does, then you can override the navigator content extensions and provide your own label providers (including the use of the JDT's label provider as Dani mentions.


Re: Add java element decoration to a common navigator [message #641684 is a reply to message #641496] Fri, 26 November 2010 18:18 Go to previous messageGo to next message
Alain Artouste is currently offline Alain ArtousteFriend
Messages: 17
Registered: October 2010
Junior Member
Francis Upton wrote on Thu, 25 November 2010 12:02

Could you use the ProjectExplorer (which has all of the resource stuff built into it)? This is simply using the org.eclipse.ui.navigator.resources plugin.



Thank you for your attention

I want to have in a wink an overview of specific resources of a project. The organization will not follow the folder hierarchy: e.g. as children of an XML file i want the generated java classes depending on the XML file.
Moreover, specific images must be associated to xml files and following to rules, decorators must be added.

I reached my objectives by this way:
Project, Folder and File classes were extended.
PackageExplorerLabelProvider was extended and getImage method was overriden.
A common navigator was created to fit the new organization.

However, it remains one last problem.
When an error occurred on a java file, an error decorator is added to the image and to all the parent folders up to the project.
I would like the image of the XML file associated to the java class to be decorated and all the parent folders the file.
Do you know a way to obtain that.

Alain
Re: Add java element decoration to a common navigator [message #641783 is a reply to message #641684] Sun, 28 November 2010 01:34 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IVFriend
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
Alain Artouste wrote on Fri, 26 November 2010 10:18
Francis Upton wrote on Thu, 25 November 2010 12:02

Could you use the ProjectExplorer (which has all of the resource stuff built into it)? This is simply using the org.eclipse.ui.navigator.resources plugin.



However, it remains one last problem.
When an error occurred on a java file, an error decorator is added to the image and to all the parent folders up to the project.
I would like the image of the XML file associated to the java class to be decorated and all the parent folders the file.
Do you know a way to obtain that.

Alain



This is the problem decoration stuff which is a separate mechanism. Unfortunately I don't understand it much at all. I suggest you make a new post with "Problem decorators" in the subject and you might attract the attention of someone who can help.


Re: Add java element decoration to a common navigator [message #663047 is a reply to message #641783] Sat, 02 April 2011 18:47 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: April 2011
Junior Member
Hi Alain,

I'm sorry, but I can't help you with your decoration problem..

However I have the same problem you already solved..
Could you please explain me what do you mean by "Project, Folder and File classes were extended" and how you overrode the getImage method?

Thanks
Re: Add java element decoration to a common navigator [message #663718 is a reply to message #663047] Wed, 06 April 2011 10:11 Go to previous message
Alain Artouste is currently offline Alain ArtousteFriend
Messages: 17
Registered: October 2010
Junior Member
Hi,

Quote:
Could you please explain me what do you mean by "Project, Folder and File classes were extended"

I created classes which extends org.eclipse.core.internal.resources.Project, org.eclipse.core.internal.resources.File, ...


Quote:
how you overrode the getImage method"

I created my own MenuNavigator which use a specific MenuLabelProvider which is inspired by org.eclipse.jdt.internal.ui.navigator.JavaNavigatorLabelProv ider.
The label provider has a field
DelegateLabelProvider delegeteLabelProvider
which refers to a class which extends org.eclipse.jdt.internal.ui.packageview.PackageExplorerLabel Provider.

Hope it helps you
Previous Topic:product export: platform specific launcher features missing?
Next Topic:Handlers enabledWhen based on String in View
Goto Forum:
  


Current Time: Thu Apr 18 18:54:09 GMT 2024

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

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

Back to the top