X

Geertjan's Blog

  • May 20, 2005

Docking a NetBeans Module in the IDE (Part 3)

Geertjan Wielenga
Product Manager
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.

Join the discussion

Comments ( 5 )
  • Brennet aurelien Thursday, July 28, 2005
    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?
  • Geertjan Thursday, July 28, 2005
    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.
  • Aaron Gage Wednesday, September 14, 2005
    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 .
  • Michael Pan Wednesday, November 9, 2005
    I am using a blank platform, it don't include a "Navigator" mode, but i need this mode now, what should I do? thanks!
  • Pranesh Monday, July 24, 2006
    why not try using the "Output" mode instead. Its close and very similar to the "Navigator" docking position.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.