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.
If you bundle multiple sample projects, you will probably create multiple wizard iterators/panels/etc. for them. However, you can easily use one set of generated wizard code for multiple sample projects. The only problem with the code as currently generated is that the visual panel will have the hardcoded name of the original project template. Adding the following to the generated code in *WizardIterator.initialize enables one iterator to be reused for multiple projects. It would be nice if the template automatically did this: FileObject template = Templates.getTemplate(wiz); String name = template.getName(); wiz.putProperty ("name", name); or if you really want to get fancy FileObject template = Templates.getTemplate(wiz); String name = DataObject.find(template).getNodeDelegate().getDisplayName(); wiz.putProperty ("name", name);
Something to consider if we ever redo project template generation: simple.project.templates in nbsrc defines a microformat inside properties files (example from Java Card here - http://hg.netbeans.org/main/raw-file/0850e3245ad2/javacard.project/src/org/netbeans/modules/javacard/templates/cap-project-template.properties ) Basically the format is relative/path/in/project=path/to/template/in/sfs with substitutions (you pass a map into the factory), e.g. src/{{packagepath}}/{{classname}}.java*=Templates/javacard/ClassicApplet.java (the asterisk denotes that the file should be opened on project creation - or at any rate, part of the set of FileObjects returned to whatever wizard called it). The microformat part is two prefixes: pp.foo={{somevalue}} means this is a property (with the pp. stripped) for project.properties; pvp.foo={{somevalue}} (with the pvp. stripped) for private.properties. or you can subclass FileCreator and pass as many as you want into the factory to create whatever you want (such as the initial project.xml). Ought to be fairly straightforward to generate this stuff, and much more flexible and saner than processing names in a zip file as it's unzipped, which is what you have to do now if you just want to give a generated java file the same name the user entered for the project.