How General Are Natures ? [message #306443] |
Fri, 28 July 2006 17:04  |
Eclipse User |
|
|
|
I am developing a plugin that depends on a small amount of persistent
data. I could persist it as a project resource, or as project metadata.
Initially I've chosen the metadata approach and implemented the data as
the X property on a project properties extension page.
A problem with this approach is that the X property appears on every
project, which is redundant. Most projects have no need for the X data.
Can I create and use an 'X' nature to limit presentation of the X
project property to projects that have the X nature?
The docs specify how to customize builds according to natures, but I
suspect/hope that natures are more general than that,
Bill
|
|
|
|
Re: How General Are Natures ? [message #306807 is a reply to message #306471] |
Sat, 05 August 2006 15:45   |
Eclipse User |
|
|
|
Paul Webster wrote:
> Bill Winspur wrote:
>
>> I am developing a plugin that depends on a small amount of persistent
>> data. I could persist it as a project resource, or as project
>> metadata. Initially I've chosen the metadata approach and implemented
>> the data as the X property on a project properties extension page.
>>
>> A problem with this approach is that the X property appears on every
>> project, which is redundant. Most projects have no need for the X data.
>>
>> Can I create and use an 'X' nature to limit presentation of the X
>> project property to projects that have the X nature?
>
>
> yes, when you create your property page add a filter, like <filter
> name="nature" value="org.eclipse.jdt.core.javanature"/>
>
> Check out the extension point description, the IActionFilter interface,
> and examples in the org.eclipse.jdt.ui plugin.
>
> Later,
> PW
Paul, thanks - exactly the guidance I needed, Bill.
|
|
|
Re: How General Are Natures ? [message #307197 is a reply to message #306471] |
Tue, 15 August 2006 14:01  |
Eclipse User |
|
|
|
Originally posted by: john.eclipsefaq.org
This will work, but if your only requirement is filtering of the
property view, then a nature seems like a bit of overkill. You can get
the same effect by adding a persistent property
(IResource.setPersistentProperty), and then use the
IResourceActionFilter.PERSISTENT_PROPERTY filter name.
--
Paul Webster wrote:
> Bill Winspur wrote:
>
>> I am developing a plugin that depends on a small amount of persistent
>> data. I could persist it as a project resource, or as project
>> metadata. Initially I've chosen the metadata approach and implemented
>> the data as the X property on a project properties extension page.
>>
>> A problem with this approach is that the X property appears on every
>> project, which is redundant. Most projects have no need for the X data.
>>
>> Can I create and use an 'X' nature to limit presentation of the X
>> project property to projects that have the X nature?
>
>
> yes, when you create your property page add a filter, like <filter
> name="nature" value="org.eclipse.jdt.core.javanature"/>
>
> Check out the extension point description, the IActionFilter interface,
> and examples in the org.eclipse.jdt.ui plugin.
>
> Later,
> PW
|
|
|
Powered by
FUDForum. Page generated in 0.03408 seconds