Geertjan's Blog

  • May 28, 2005

Adding Nodes to the NetBeans IDE's Runtime Window

Geertjan Wielenga
Product Manager
Using a sample I found on-line in an old (very very old) document, I achieved something that I've been hoping to achieve ever since I started learning about NetBeans Modules: I added some nodes to the IDE's Runtime window. And, finally, I have a working sample that I can play with and learn from, specifically in relation to the Nodes API. Here's the evidence:

The sample is actually pretty useful (i.e., it goes way beyond the 'Hello World' type examples that I've been building so far). It creates a node with a very large number of subnodes, each labeled according to a key for specific Java properties. It even lets me add new properties and modify existing ones. Because the sample was so old, several of the methods have been deprecated. However, fortunately, there's a very helpful Upgrade Guide, which told me how to replace TopManager and that a module is installed in the Runtime window via the following entry in the layer.xml (instead of via entries in manifest.mf, which is how you used to have to install a module in the Runtime window):

<folder name="UI">
<folder name="Runtime">
<file name="org.netbeans.modules.sysprops.AllPropsNode.instance">
<attr name="instanceClass"

And, by the way, this is the structure of my module in the Projects window:

(It's a pity that the Projects window doesn't display the files in the top-level directory, because that means that the Projects window doesn't display my manifest.mf file as well as the sysprops.nbm file -- i.e., the NetBeans Module itself -- which means I have to keep switching to the Files window whenever I want to modify the manifest.mf file or delete the NetBeans Module. I should probably add the module to the clean target, but in such a way that the manifest.mf isn't included. Still, it would be nice to be able to see the top-level directory in the Projects window.)

Now that I've got this working sample, I can play around with it and really begin to understand how each part works. I'll be blogging more about this sample and the Nodes API in the coming weeks.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.