Atomic add and configuration of nature [message #333514] |
Tue, 16 December 2008 12:55 |
Damian Philipp![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=damian.philipp%40flexis.de) Messages: 30 Registered: July 2009 |
Member |
|
|
Hello everyone,
I am (still) working on a plugin that does some custom compilation stuff
on arbitrary projects. Projects to be considered by my plugin are marked
by the addition of a custom nature.
In order to know what to do with a project, my plugin requires a
configuration file. This configuration file does not have a fixed name
and may or may not exist initially. The location of the configuration
file is to be stored as a persistent property on the project resource.
The question is, what would be the correct place to prompt the user for
this file? IProjectNature#configure() is not enough, as that place is
only called when the nature is added programatically. Plus, some of my
code (namely a Project Explorer extension) was run even before
#configure() was called. In cases where the project is created by
importing preconfigured source code (eg. from subversion), this won't work.
I did think about putting checks for the configuration file everywhere.
However I'd rather not loose the simplicity of IProject#hasNature() to
test whether there is something to be done with a project, as there are
most likely going to be some more constraints apart from the presence of
a configuration file in the futute.
So, is there a way to make sure that a nature does never exist without
some additional constraints being met?
Regards
Damian
|
|
|
Powered by
FUDForum. Page generated in 0.03343 seconds