Re: project conversion questions
Svata Dedic <[email protected]> Wed, 30 Jul 2003 22:07:49 +0200
| Newsgroups | gmane.comp.java.netbeans.modules.projects.devel |
|---|---|
| Message-ID | <[email protected]> |
Peter Wisnovsky wrote: > > Instead of DataObject.find() just use > > theProjectInstance.getProjectMember(theFile) to get a ProjectMember > > (file's representant within the project). > > Hmm...so I tried this conversion and did it in a wizard, where I don't > have a project. (I notice there is no getTargetProject in the > TemplateWizard class...should there be?). When I try: > I think it should not - at least in the TemplateWizard interface; but possibly project action-initiated Wizards could have a reference to the destination project in some of Wizard's properties, whose name would be declared in Project APIs and would be used by project-aware wizards. No idea about "global" or "context-free" actions. > java.lang.RuntimeException: Could not find newly created object > at com.sun.s1s.jpe.module.resources.MetaClassWizardIterator.createClassElement(MetaClassWizardIterator.java:78) > at com.sun.s1s.jpe.module.resources.ServiceWizardIterator.instantiate(ServiceWizardIterator.java:164) AAARGH! I am very sorry -- I made a mistake (maybe I am still used to old and long obsolete semantics :-() Please use Project.findAll() to find all projects, which the file in question belongs to (if there are any), then choose some and use thatProject.getProjectMember(thatFile). Refer to Project.find() javadoc for exact description of how the call works. Sorry again, -Svata