Project nature and more [message #161514] |
Tue, 25 November 2003 08:50  |
Eclipse User |
|
|
|
Hi all
I have a plugin which currently uses preferences for storing some
important data. however, I'd need to make this preferences project
dependent. My questions are:
- Do I need to create a project nature for this?
- How do I attach preferences to the project? in a file/directory?
- How difficult is to detect project with my nature open / close events
and show / hide my views ?
Any help/pointer appreciated
|
|
|
|
Re: Project nature and more [message #161546 is a reply to message #161522] |
Tue, 25 November 2003 11:10   |
Eclipse User |
|
|
|
Originally posted by: Michael_Valenta.oti.com
There is currently no general mechanism for associating "preferences"
with a project. There is a mechanism provided by Platform Core
(IResource#setPersistantProperty) which allows extra information about a
resource to be persisted and this could be used to store user
preferences. However, the persistance of and access to persistant
properties are managed by Core and there is not change notification on
persitant property changes.
There is a 3.0 plan item for user settings which may address this
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=36965). Up until now, any
plugins that have project dependant preferneces have provided their own
mechanisms for handling them (e.g. JDT .classpath, JDT compiler options).
Project open and close can be detected using the Core delta change
notification mechanism (see IResourceChangeListener).
Michael
Thorsten Schäfer wrote:
> Hi,
>
>
>>I have a plugin which currently uses preferences for storing some
>>important data. however, I'd need to make this preferences project
>>dependent. My questions are:
>>- Do I need to create a project nature for this?
>>
> No, a nature doesn't help you in this case.
>
>
>>- How do I attach preferences to the project? in a file/directory?
>>
> Check out IProject.setPersistentProperty
>
>
>>- How difficult is to detect project with my nature open / close events
>>and show / hide my views ?
>>
> Sorry, don't know. I've asked a question covering this topic to (How can a
> plugin save project-dependend state), but up to now there's no answer. Let's
> see if there are other solutions... ;)
>
> HTH,
>
> Thorsten
>
>
>
|
|
|
Re: Project nature and more [message #163041 is a reply to message #161522] |
Thu, 27 November 2003 13:31  |
Eclipse User |
|
|
|
Originally posted by: John_Arthorne.oti.com_
There is a meta-data directory reserved for each plug-in to store
project-specific state. Use
IProject.getPluginWorkingLocation(yourPluginDescriptor) to access this
location. You can store your plugin state in some file in this
directory (such as a properties or xml file). The platform will take
care of deleting this directory if the project is deleted.
--
Thorsten Schäfer wrote:
>
> Sorry, don't know. I've asked a question covering this topic to (How can a
> plugin save project-dependend state), but up to now there's no answer. Let's
> see if there are other solutions... ;)
|
|
|
Powered by
FUDForum. Page generated in 0.02658 seconds