This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Buildsys asked make a Instantiating iterator (as replacement of TemplateWizard.Iterator) This iterator should be used in Projectui API.
Created attachment 14482 [details] proposed InstantiatingIterator
What is the 'Object settings' param to instantiate(...)? Can it be removed?
By reason of Jarda's objection I assign back to me. The API change should be implemented in WizardDescriptor (the methods be called in right times), at least e.g. projectui/NewFileWizard uses it in practice to figure out what methods and its parameters are useful, of course code should be covered by a test.
Usecases needed. Please do not integrate an API without it being used (at least in the test). The way how I think the new interator should be used and tested: TemplateWizard should allow this new interface to be assigned to templates in layer. It is enough to rewrite TemplateWizard.getIterator to do instanceof and in the case WizardDescriptor.InstantiatingIterator is found wrap it by delegating TemplateWizard.Iterator and use it. The test should create a DataObject, mark it as template, write a serializable InstantiatingIterator, assign it as a attribute to the DataObject's primary file. Create TemplateWizard, set the object as template, try to switch to next panel, check that the initialize method has been called, ...., press finish and check that the instantiate method has been called. Second use case should be in plain WizardDescriptor. If a finish button is pressed and the wizard is closed, it should check whether the iterator implements InstantiableIterator and if so call its instantiate method. It would be good if WizardDescriptor could then return the set created objects. Maybe WD.getValue(), maybe new method? The test would just create new WD with InstantiableIterator, check that the initialize method has been called and then go thru panels until finish is clicked. Then its instantiate method should be called (this would be nice to check together with validation, if validation fails the instantiate should not be called at all) and that the correct value is not available from the WD.getValue (or the new method). These two use cases should guarantee: 1. that we are not creating API that is not used at all 2. that we can use the API in templates 3. that we use the API in the same place where we define it (openide/dialogs) and not just in openide/loaders Btw. I agree with Jesse that the object argument to the instantiate is ugly and seems useless.
Sorry but we need this API very quickly. I don't care about automatic usage from WizardDescriptor; we have no use case for that, it is speculation. Usage from TemplateWizard is also irrelevant to us, and serialized object compatibility is probably P3. We simply need a non-loaders-specific replacement for TW.I, to be used immediately from projects/projectuiapi and probably elsewhere (java/platform?). There is no need for any test here because there should be no impl here, only an interface. If you have other proposed uses for this interface, great, but they should be filed and tracked separately and they are probably not P1.
*** Issue 34043 has been marked as a duplicate of this issue. ***
Created attachment 14661 [details] next draft of task implementation
a attachment impl42192_draf2 contains: 1) implementation of WizardDescriptor.InstantiatingIterator in class WizardDescriptor, the new methods are called in designed times 2) WizardDescriptor.InstantiatingIterator is used in TemplateWizard 3) WizardDescriptor.InstantiatingIterator replaces TemplateWizard in projects/projectui and java/project on each place where can be replaced w/o any change of implementaion 4) InstantiatingIterator is covered by InstantiatingIteratorTest Note: this version isn't fully operarated (at least TemplateWizard's part is buggy, but can be tested w/o it). Next versions will be continued.
Created attachment 14670 [details] a draft of changes to avoid TW.I prepared to integrate
This impl42192_draft3.diff covered the changes and remarks raised during API_REVIEW. I'm going to integrate it tomorrow (2004/05/04). Thanks for opinions and advices. The attached diff contains: 1) adds new InstantiatingIterator and implements it in WD 2) unit test covers InstantiatingIterator functionality 3) implements bridge to new iterator in TemplateWizard 4) WD.InstantiatingIterator replaces links to TemplateWizard in projects/projectui and java/project on each place where can be replaced w/o any change of implementation 5) beans and form modules declared project's JavaTemplates in its layers
The proposed draft #3 has been integrated in main trunk.