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

Trackback URL: http://blogs.sun.com/geertjan/entry/docking_a_netbeans_module_in2
Comments:

I want to thank you for your website. Every day i connect on it to see the news. The navigator mode doesn't function with me. when i move a TopComponent in navigator mode which is in explorer mode before, the topcomponent is in an anonymous mode in Window2Local directory. why?

Posted by Brennet aurelien on July 28, 2005 at 03:05 AM PDT #

Hi Brennet -- thanks for stopping by! Good to know you find this blog useful. (It's main intention is as a kind of diary for myself -- to track what I've learnt and to be able to quickly find code snippets etc., such as Ant scripts, that I frequently use -- but it's cool to see that others gain something from it too.) About your question -- off the top of my head I don't know the answer. I'd advise joining and contributing to a great mailing list that is dedicated to plug-in development: dev@openide.netbeans.org. I'll try and look into this question too though.

Posted by Geertjan on July 28, 2005 at 03:11 AM PDT #

One thing to keep in mind is that only some of the modes (Explorer, Editor, Output, and Properties, I believe) are in the standalone platform. The Navigator and Palette modes are used by the IDE, and if you are loading your module into the IDE, they will be found. If you are using the plain platform without the IDE, then the modes won't be found. If you really want these modes, you can look in the IDE sources. Navigator mode's wsmode file is located in: netbeans-src/objectbrowser/navigator/src/org/netbeans/modules/navigator/resources/navigator.wsmode . The palette's wsmode file is: netbeans-src/form/src/org/netbeans/modules/form/resources/windowmanager/palette.wsmode .

Posted by Aaron Gage on September 14, 2005 at 01:41 PM PDT #

I am using a blank platform, it don't include a "Navigator" mode, but i need this mode now, what should I do? thanks!

Posted by Michael Pan on November 09, 2005 at 11:33 PM PST #

why not try using the "Output" mode instead. Its close and very similar to the "Navigator" docking position.

Posted by Pranesh on July 24, 2006 at 11:15 PM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed