Re: project conversion questions

Svata Dedic <[email protected]> Sat, 27 Sep 2003 12:35:27 +0200
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Message-ID <[email protected]>
Peter Wisnovsky wrote:
> 
>         // Find the project
>         Project project = (Project) wiz.getProperty("project");
>         if (project == null)
Hmm I guess this is probably the worst thing to ever do - to use a 
string instead a manifested constant. If a constant for such Wizard 
property is missing, it is probably a hint that the property does not 
exist, either.

Java class Wizards now use a little workaround -- they rely on the fact 
that the natures are made a part of the project's internal FS; so they 
use Project.find(theTemplateFileObject). I don't know if this assumption 
is reliable for the future or not, but clearly it relies on an 
implementation detail (however fixed by the architecture) and should be 
changed.

I was able to find only one place where the projects module provides the 
project instance through wizard properties - the ProjectsListPanel, used 
from API method IdeProject.addWizard() (that lacks any JavaDoc, BTW). I 
am almost positive that it is not exposed in project TemplateWizards yet.

-Svata