Using org.eclipse.ui.projectNatureImages extension point [message #129333] |
Mon, 15 September 2003 10:42  |
Eclipse User |
|
|
|
Hi,
With Eclipse 2.1 on Windows XP, I would like to add my own project nature
image to a project so that in the navigator view I can tell which projects
have my nature. In order to try and do this I am using the
org.eclipse.ui.projectNatureImages extension point in the following way
inside my plugin's plugin.xml file (where the nature "mynature" has
already been defined) :-
<extension point="org.eclipse.ui.projectNatureImages">
<image
id="org.eclipse.myproj.ui.mynatureImage"
natureId="mynature"
icon="icons/structure/myicon.gif">
</image>
</extension>
When the custom nature gets added to a project the expected outcome does
*not* take place - that is, my icon does *not* get overlaid on projects
with my custom nature in the navigator view. My plugin is extending the
JDT so I am adding my custom nature to the existing Java nature of a
project. However, all of the projects with my nature are still displaying
the "J" icon of a Java project.
Has anyone else encountered problems using this extension point or (more
likely) am I doing something wrong ?
I am a relative Eclipse newbie so if this question has previously been
answered on this group or else on some FAQ that you are aware of I would
be very grateful if you could point me at it. Likewise, if this is not the
appropriate group for asking this question then please let me know where
it should be asked.
Thanks
--
George
|
|
|
|
Re: Using org.eclipse.ui.projectNatureImages extension point [message #129788 is a reply to message #129423] |
Mon, 15 September 2003 16:41   |
Eclipse User |
|
|
|
On Mon, 15 Sep 2003 11:19:24 -0400, Simon Arsenault <simon@ibm.oti.lab>
wrote:
> It is order dependent. When you add your nature to the list of natures,
> add
> it at the start.
>
> Simon :-)
>
> "George Harley" <gharley@uk.ibm.com> wrote in message
> news:oprvjpsjnf22j3z7@eclipse.org...
>> Hi,
>>
>> With Eclipse 2.1 on Windows XP, I would like to add my own project
>> nature
>> image to a project so that in the navigator view I can tell which
>> projects
>> have my nature. In order to try and do this I am using the
>> org.eclipse.ui.projectNatureImages extension point in the following way
>> inside my plugin's plugin.xml file (where the nature "mynature" has
>> already been defined) :-
>>
>> <extension point="org.eclipse.ui.projectNatureImages">
>> <image
>> id="org.eclipse.myproj.ui.mynatureImage"
>> natureId="mynature"
>> icon="icons/structure/myicon.gif">
>> </image>
>> </extension>
>>
>> When the custom nature gets added to a project the expected outcome does
>> *not* take place - that is, my icon does *not* get overlaid on projects
>> with my custom nature in the navigator view. My plugin is extending the
>> JDT so I am adding my custom nature to the existing Java nature of a
>> project. However, all of the projects with my nature are still
>> displaying
>> the "J" icon of a Java project.
>>
>> Has anyone else encountered problems using this extension point or (more
>> likely) am I doing something wrong ?
>>
>> I am a relative Eclipse newbie so if this question has previously been
>> answered on this group or else on some FAQ that you are aware of I would
>> be very grateful if you could point me at it. Likewise, if this is not
>> the
>> appropriate group for asking this question then please let me know where
>> it should be asked.
>>
>> Thanks
>> --
>> George
>
>
Thanks Simon. After reading your post I revisited the code where the
custom nature gets added to the project's existing Java nature and did a
slight mod to ensure that the custom nature gets added *before* the Java
nature.
Unfortunately this does *not* appear to make any difference to the outcome
: my projects always seem to have the little "J" icon positioned top-right
of their folder image. Any other suggestions for things to look out for
that could affect this ?
Thanks in advance,
--
George
|
|
|
Re: Using org.eclipse.ui.projectNatureImages extension point [message #129814 is a reply to message #129788] |
Mon, 15 September 2003 17:34  |
Eclipse User |
|
|
|
On Mon, 15 Sep 2003 21:41:09 +0100, George Harley <gharley@uk.ibm.com>
wrote:
> On Mon, 15 Sep 2003 11:19:24 -0400, Simon Arsenault <simon@ibm.oti.lab>
> wrote:
>
>> It is order dependent. When you add your nature to the list of natures,
>> add
>> it at the start.
>>
>> Simon :-)
>>
>> "George Harley" <gharley@uk.ibm.com> wrote in message
>> news:oprvjpsjnf22j3z7@eclipse.org...
>>> Hi,
>>>
>>> With Eclipse 2.1 on Windows XP, I would like to add my own project
>>> nature
>>> image to a project so that in the navigator view I can tell which
>>> projects
>>> have my nature. In order to try and do this I am using the
>>> org.eclipse.ui.projectNatureImages extension point in the following way
>>> inside my plugin's plugin.xml file (where the nature "mynature" has
>>> already been defined) :-
>>>
>>> <extension point="org.eclipse.ui.projectNatureImages">
>>> <image
>>> id="org.eclipse.myproj.ui.mynatureImage"
>>> natureId="mynature"
>>> icon="icons/structure/myicon.gif">
>>> </image>
>>> </extension>
>>>
>>> When the custom nature gets added to a project the expected outcome
>>> does
>>> *not* take place - that is, my icon does *not* get overlaid on projects
>>> with my custom nature in the navigator view. My plugin is extending the
>>> JDT so I am adding my custom nature to the existing Java nature of a
>>> project. However, all of the projects with my nature are still
>>> displaying
>>> the "J" icon of a Java project.
>>>
>>> Has anyone else encountered problems using this extension point or
>>> (more
>>> likely) am I doing something wrong ?
>>>
>>> I am a relative Eclipse newbie so if this question has previously been
>>> answered on this group or else on some FAQ that you are aware of I
>>> would
>>> be very grateful if you could point me at it. Likewise, if this is not
>>> the
>>> appropriate group for asking this question then please let me know
>>> where
>>> it should be asked.
>>>
>>> Thanks
>>> --
>>> George
>>
>>
>
> Thanks Simon. After reading your post I revisited the code where the
> custom nature gets added to the project's existing Java nature and did a
> slight mod to ensure that the custom nature gets added *before* the Java
> nature.
>
> Unfortunately this does *not* appear to make any difference to the
> outcome : my projects always seem to have the little "J" icon positioned
> top-right of their folder image. Any other suggestions for things to
> look out for that could affect this ?
>
> Thanks in advance,
Whoa ! Just found out that I was using an incorrect value for the natureId
attribute of my image element. I was not qualifying the id with the plugin
id (i.e. my natureId value was "mynature" whereas it should have been of
the form "my.plugin.id.mynature").
So it seems that getting the order of the natures right and using the
fully qualified nature id was what I required to get this to behave as
planned.
Thanks for your help !
--
George
|
|
|
Powered by
FUDForum. Page generated in 0.04203 seconds