Experimenting with Dockable Windows

Rather than trying to put the relationships between the various windows into words, I think an exercise is in order. I'll start with the most basic docking operations and move to the more complex. This exercise doesn't take long and should prove very enlightening. Here goes:

  1. Create a new application and switch to the Code Editor. Notice the Code Explorer is docked to the left side of the Code Editor.
  2. Click the grip at the top of the Code Explorer window and drag to the right. Notice that you are dragging a gray rectangle. This rectangle indicates where the Code Explorer will appear when you stop dragging.
  3. Drag the Code Explorer to the middle of the Code Editor and let go of the mouse. The Code Explorer becomes a floating tool window.
  4. Click on the title bar of the Code Explorer tool window and drag it back to the left side of the Code Editor. When your mouse pointer reaches the left edge of the Code Editor, the drag rectangle pops into place. Let go of the mouse and the Code Explorer is once again docked to the Code Editor.
  5. Undock the Code Explorer again and drag it to the bottom of the Code Editor. When your mouse pointer reaches the bottom edge of the Code Editor window, the drag rectangle snaps into place and is as wide as the Code Editor. Let go of the mouse button. The Code Explorer is docked to the Code Editor's bottom dock site. Notice that the drag grip is vertical when the Code Explorer is docked to the bottom dock site.
  6. Move the Code Explorer back to the dock site on the left side of the Code Editor window. The Code Editor and Code Explorer should now look like they did when you started.

This exercise is simple but gives you an idea of what you can do with dockable windows at the most basic level. The next exercise is a little more interesting. Perform these steps:

  1. Undock the Code Explorer and move it to the right. Drop it anywhere on the right side of the Code Editor.
  2. Size the Code Explorer window so that it is roughly square.
  3. Choose View | Project Manager from the main menu. The Project Manager is displayed.
  4. Drag the Project Manager over the Code Explorer window. When the drag rectangle snaps into place in the center of the Code Explorer window, release the mouse button. The floating tool window should now look similar to Figure 4.15. Notice that the floating tool window has become a tabbed window and has the title Tool Windows. You can click on either of the two tabs to see the Code Explorer or the Project Manager.

FIGURE 4.15. The Code Explorer and Project Manager docked together in a tool window.

5. Drag the tool window back to the left side of the Code Editor and dock it there. Now you have both the Code Explorer and the Project Manager docked where you can get to them easily whenever you want them.

Are you starting to get the picture? You can have as many tool windows as you want in one tabbed window. Let's do one more exercise along the same lines. Often you want the debugger Watch List window in view while you are debugging (debugging is discussed on Day 10, "Debugging Your Applications"). Let me show you how you can keep the Watch List window handy at all times. Perform these steps:

  1. Right-click on the Code Editor and choose Message View from the Code Editor context menu. The message window appears in the Code Editor's bottom dock site.
  2. Choose View | Debug Windows | Watches from the main menu. The Watch List window is displayed as a floating tool window.
  3. Drag the Watch List window over the Message window and dock it to the center of the Message window. Two tabs appear in the dock site: Messages and Watch List.

Now you can click on the Watch List tab at the bottom of the Code Editor anytime you want to view your watches. The Message window takes care of itself, as it will come and go in the tabbed window any time there are messages to display. Figure 4.16 shows the IDE after performing the last exercise.

FIGURE 4.16. Four tool windows docked to the Code Editor.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment