Download NetBeans!

20050520 Friday May 20, 2005

Docking a NetBeans Module in the IDE (Part 3)

To "dock" a module means embedding it in one of the IDE's (or the Platform's) modes. There are several modes to chose from. For example, by default the Favorites window's module (org.netbeans.modules.favorites) is docked in the 'Explorer' mode. This mode is on the left side of the IDE where the Projects window and Files window are displayed by default. Each module can have an opened state of 'true' or 'false'. By default, the Favorites window, for example, has an opened state of 'false', so that by default it is not displayed when you open the IDE. The modes and their modules' settings are stored in the IDE's user directory. By default, you should have the following modes:

Within each of the subfolders within the 'Modes' folder above, a reference file is found for every module that is docked in the mode. For example, the reference file for the Favorites module is found in the 'explorer' folder above. These reference files have a .wstcref extension. This stands for Windows System Top Component Reference. For example, this is the complete content of the favorites.wstcref file:

<?xml version="1.0" encoding="UTF-8"?>
<tc-ref version="2.1">
    <module name="org.netbeans.modules.favorites/1" spec="1.1" />
    <tc-id id="favorites" />
    <state opened="false" />
</tc-ref>

The effect of docking a module can best be described visually. Below is the Anagrams module created over the last few blog entries, but -- unlike previous blog entries -- it can now be docked in various modes in the IDE (click to enlarge each of the screenshots below).

Explorer mode:

Editor mode:

Output mode:

Properties mode:

Navigator mode:

Many thanks to Petr Blaha for restructuring the Anagrams sample so that it works as a docked module. Next blog entries will talk about this as well as step-by-step instructions for putting everything together.

May 20 2005, 03:35:48 AM PDT Permalink