If you're a component developer who doesn't mind working on the bleeding edge and are writing new components for NetBeans Visual Web Projects (WVP), this entry is for you. Writing components for VWP using the tried and true method of building and creating a complib file and then importing it into the IDE produces a long painful edit-deploy-test cycle. I've been there because I am also currently working on adding VWP support for jMaki components. See the NetBeans RFE on this very problem.
I've created a first pass implementation to fix this problem on the NetBeans 6 trunk. Unfortunately, it has some file locking issues on Windows that I haven't figured out, but by restarting the IDE, it should still be somewhat usable. It's also on the bleeding edge so be prepared for some other possible unknown IDE instability, but having used it myself for a week or so leads me to think that it is an improvement. The basic idea is that the component library will exist in one or more NetBeans Library projects. Your test webapp will exist in a separate NetBeans Web project. The test webapp NetBeans Web project will depend upon the component library NetBeans Library project to provide it with the classes it needs for the components. In effect, component libraries are implemented as standalone projects that are shared instead of embedded within a Web project. For more information on component libraries see the main component library page I maintain.
To use this new feature, you first need to run a current version (around 2007-03-02 or later) of the NetBeans 6 trunk. Next, create at least one NetBeans Library project that contains your component library. The project should have an ant target to build a "complib" file and the current implementation assumes it will produce an expanded directory structure at "$(my-project-dir)/build/complib/".
The next step is to create a test webapp NetBeans Web project. As I understand it, in NetBeans 6, there will no longer be a separate "Visual Web" project. Instead there will be a single "Web" project with a "Visual JSF" framework that you can add to it so be sure to select the "Web Project" in the New Projects Wizard and ignore the "Visual Web Project" if such an entry still exists. Proceed to add the "Visual JSF" framework. The following UI is temporary. Open "index.jsp" and select the "Design" view. Select Tools->Shared Component Libraries. Use this dialog to manage any shared libraries that are being used by the currently active project. The dialog recognizes open component library projects that are in the format described above. It also allows you to see which shared libraries the currently active project depends on and also to refresh the palette.
A typical development cycle goes like this:
- Add a component from the palette to the test webapp.
- Test the component at design-time and runtime.
- See something is wrong.
- Fix the problem in the component library project.
- Rebuild the component library project.
- If needed, refresh the palette from the Shared Component Libraries dialog.
- Retest by building the test webapp.
Note: as I mentioned before, on Windows there are file locking issues that I haven't resolved, but by restarting the IDE or maybe even only closing and re-opening projects and the deployment server, it should still be somewhat usable. I'd appreciate any feedback so please let me know if this is useful to you.