So, I've created a new wizard, called "Multiple Project Template". If you go here, you can install it:
Make sure you install it in NetBeans IDE 6.0 Beta 1. It could possibly work in other versions, and development builds, too, but no promises. Especially since I needed to set an implementation dependency on the "NetBeans Module Projects" module (because it currently does not provide an API), there is no guarantee that it will work in anything other than NetBeans IDE 6.0 Beta 1.
Once you have it, create a module project. (Or, use an existing module project.) Then go to the New Project wizard and choose "Multiple Project Template" from the NetBeans Module Development category, as shown here:
Click Next. Now you see the wizard panel below, where you can browse to folders that contain NetBeans projects (any kind of NetBeans project, so long as it is a NetBeans project) and, from those projects, select the ones that you want to register as samples:
Once you're happy with your choices, click Next, choose a category and a package, and the IDE shows you a long list of all the new files that will be created or changed:
Finally, click Finish. The IDE zips up the selected applications and adds all Java classes, files, layer registration entries, and Bundle keys needed, as well as setting all the required project dependencies. The result, for the six samples by Chet and Romain shown above, is as follows:
You can install the module immediately, no post processing of any kind is necessary. For the samples selected above, the result is as follows, i.e., they are added to the Java samples category, supplementing the 4 existing ones:
Next, you can go back to the generated module sources and use the dummy HTML files to add descriptions for your samples. You can also change the icons in the New Project wizard, as described in the tutorial referenced at the start of this blog entry. And that's it. You're done and your samples are good to go. Hurray, that will save me a lot of time when bundling samples from now onwards!
Update. See Enhancements to the Multiple Project Template for enhancements, provided by the 2.0 version of this plugin.