Step 4.5: Side-by-side editing


Step 4.5: Side-by-side editing

click to expand

One of the more powerful but less intuitive features of the Eclipse IDE is something they call "docking". I think of it as "split screen" or "tiling" or "side by side," where I can take two stacked panels and place them side by side so that I can see both. If I want, I can then restack the panels.

Eclipse does this quite well via the docking concept, but it takes a little bit of getting used to. Basically, it's all done through a drag-and-drop mechanism. Dragging an editor tab to the border of the editor panel will change the cursor to a docking cursor and allow you to split the panel.

Dragging a tab from one split pane to another moves it. Moving the last tab out of a pane deletes the pane. You can split horizontally or vertically, and you can split the panes as many times as you wish, with the practical limit being the amount of screen real estate you have.

We're using an 800x600 screen in this manual for readability, so there isn't a lot of real estate, but in larger screen sizes this feature is very powerful, since you can easily cut and paste or drag and drop from one pane to another.

q 4.5(a) Select the Step List.txt editor tab and drag it downward.

Remember, dragging is done by clicking on an object with the left mouse button, holding the button down, and moving the cursor with the mouse.

click to expand
Figure 4.26: First, select the Step List.txt file, but hold down the cursor button.
click to expand
Figure 4.27: Then start dragging the cursor downward.

You'll notice that the cursor icon changes to a stack of folders. This indicates that you can drop this folder into this stack. This is not the docking cursor.

q 4.5(b) Drag the cursor to the left border of the editor panel.

click to expand
Figure 4.28: When you hit a border, the cursor changes to a docking cursor (a heavy arrow).

The cursor changes to a heavy left-pointing arrow. This is the docking cursor. It indicates that you can now drop the tab, and it will split the pane to the left.

q 4.5(c) Drop the editor (release the mouse button).

click to expand
Figure 4.29: After successfully docking the Step List.txt editor, you now have a split panel.

This is the side-by-side or tiled effect we were trying to achieve. Not very intuitive, as I said, but very easy once you get the hang of it. I suggest playing with this a bit. By dragging the cursor to the top, right or bottom half of the panel, you can split in any of those directions. A split panel can be resplit as many times as is practical based on you display resolution.

Now that you can split panels, you need to know how to merge the split panels once again. That's not particularly intuitive either, but once you know the trick it's very simple.

q 4.5(d) Click and drag the project tab.

click to expand
Figure 4.30: Getting ready to rejoin the panes: first, drag the project editor.

q 4.5(e) Drop the project tab on the Step List.txt pane.

click to expand
Figure 4.31: Drop the project tab on the Step List.txt editor.
click to expand
Figure 4.32: And they're together again!

This last drag-and-drop rejoined the project editor with the Step List.txt editor. Since the stack that used to hold the project editor is now empty, it is removed from the screen. By now, you should have a reasonable comfort level with using the editor, opening files, moving them around in your project and so on.

Next, it's time to look at a more specific perspective, namely the Java perspective.




Eclipse
Eclipse: Step by Step (Step-by-Step series)
ISBN: 1583470441
EAN: 2147483647
Year: 2003
Pages: 90
Authors: Joe Pluta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net