Becoming a Proficient NetBeans Module Developer
NetBeans has a learning curve. The goal of this article is to get you over the basic humps quickly. Being proficient does not necessarily mean knowing everything there is to know. It means being able to find what you need to know quickly when you need it. Here are some pointers.
All of the documents linked here are also available from del.icio.us.
It's a good thing to bookmark.
Javadoc
The reference documentation for all of NetBeans APIs can be found on the web here:
http://www.netbeans.org/download/dev/javadoc/
If you want a local copy of it, you can either download it from the update center, or build it from your source checkout
cd $NB_SRC_ROOT
ant build-javadoc
Using the Javadoc
Notice the list of APIs in the upper left in the javadoc. These restrict the list of classes to a single API. /Also notice the link that says _javadoc_ next to each API name. It's important! This links to the overview page for each API. That page contains a list of changes, an architecture description, and other very useful stuff!/
NetBeans Tutorials
There are a
huge number of tutorials. Do at least some of them - step by step.
FAQs
There is a huge
Frequently Asked Questions for Module Developers list. It is worth bookmarking.
Getting the Source Code
Some people claim that they should never need to look at source code - documentation should suffice. That's just silly. The NetBeans codebase is a treasure-trove of examples of how to do things.
Since the end of January 2008 the NetBeans sources are stored in Mercurial repository at hg.netbeans.org.
You can see useful documentation about Mercurial and also about its specifics for NetBeans repository in HgMigrationDocs wiki topic. If you are already familiar with Mercurial you cat go directly to HgHowTos topic.
You will end up with a large number of directories representing top-level NetBeans projects. Most of them will be openable as projects in NetBeans. Most have additional module projects underneath them.
Here's how to build it.
The build of NetBeans will be created in nbbuild/netbeans.
How To Find Useful APIs
See the
tasks to APIs faq for a list of common tasks and what APIs you will want to use to accomplish those tasks.
There are a large number of samples. Many of these correspond to the tutorials. You can find the samples in module
platform in
main/misc repository at hg.netbeans.org. They are in the
samples/ subdirectory. The
platform/samples/ folder can be
browsed online here.
First get platform sources from
download page or use Hg client as described in
HgHowTos.
To build platform run
cd $NB_SRC_ROOT
ant build-platform
Mining the NetBeans Source Code for Examples
For most things you will need to do, there is some module that does something similar already. For example, say that you want to show a window that shows the contents of some random directories on disk or some registry of objects your module creates. The
core/favorites module provides the Favorites window which does exactly this. A bit of intuition and a willingness to open a couple of projects is all it takes to find examples of many things. Often a good place to start is simply to open the source for a class you think you want to use and run Find Usages on it.
Use the Mailing Lists
If you have questions, the best place to go is the
developer mailing list. Click
this link to subscribe. You can also get there via a newsreader by going to
news://news.gmane.org or
access them on the web via Nabble. Ask questions, and when you can answer them, do that too. There is a very healthy and helpful community there.