Re: project conversion questions
Peter Wisnovsky <[email protected]> Sat, 27 Sep 2003 11:58:36 -0700
| Newsgroups | gmane.comp.java.netbeans.modules.projects.devel |
|---|---|
| Message-ID | <[email protected]> |
Svata Dedic writes:
> 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.
I'd be happy to do anything here that works reliably. It just seems
really wierd to me that I'm asked which project I want something in in
the target chooser panel but there is no way to find out what the user
selected in my iterator.
> 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.
Hmmm...if it works it works, but does this mean that templates are
scoped per project? I would observe thats in general harder to find
things like this in 4.x as opposed to 3.x because I can't explore the
project filesystems as I could explore the system filesystem in 3.x.
> 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.
Yeah, I was rummaging around in that package, but its not clear to me
how the chooser panel gets into the wizard in the first place. I don't
find references to projects anywhere in the public API package
implementation.
Peter