Step 6: The Debug Perspective


So far you've seen the Resource perspective and the Java perspective. These two were similar to one another because they served a similar purpose: group sets of objects, and then allow navigation and manipulation of those objects. The major difference is that the Java perspective is a bit more focused and specific. Many perspectives will be of this nature; I call them navigation perspectives, or sometimes just navigators.

There are other kinds of perspectives, however. Some perspectives are geared toward a single task. The Debug perspective is one of those. It has special views and a layout specifically designed to allow you as the programmer to interact with the currently running program and perform the various activities associated with debugging, such as setting breakpoints and inspecting variables ..

Step 6.1: Open the Debug perspective

click to expand

This is another way to open a perspective. To get to the Java perspective, you opened a new Java project. If that were the only way to switch to a new perspective, you'd have a lot of junk projects, but of course that's not your only option. In this step, you'll use the main menu bar to open and close the Debug perspective.

q 6.1(a) From the main menu bar, select the Window menu.

click to expand
Figure 6.1: Select the Window option on the main menu bar.

q 6.1(b) Select Open Perspective/Debug.

click to expand
Figure 6.2: Select Open Perspective/Debug to switch to the debug perspective.

Figure 6.3 shows the Debug perspective. There's not much to see at this point, since you have no programs running, but I wanted you to see a perspective that is significantly different in initial appearance from the usual navigator-type perspectives you've seen up to now.

click to expand
Figure 6.3: The Debug perspective, although it's pretty empty because nothing is running.

Note that a new icon (the little bug) has appeared on the perspective bar at the left. Whenever you open a new perspective, its icon shows up on the perspective bar. You can also switch perspectives and open and close them from the perspective bar, but I'll leave that for another time.

Although the Debug perspective isn't particularly useful yet, you can at least wander around it a little bit. For example, the upper left pane is the debug pane. That pane has a toolbar with a number of options. Most are grayed out (disabled), but you can still roll your mouse pointer over them to get a hint.

If you roll over the buttons as shown in Figures 6.4 and 6.5, you'll see the Resume tool and the Step with Filters/Step Debug tool, both of which will be familiar to programmers who have used IDEs before. If you don't recognize them, don't worry; I'll explain them in detail in Part II.


Figure 6.4: The Resume tool button.
click to expand
Figure 6.5: The Step with Filters tool button.

There are multiple ways to close a perspective, but the most straightforward is probably to use the main menu bar. Selecting Window/Close Perspective will close the currently displayed perspective.

q 6.1(c) From the main menu bar, select Window/Close Perspective.

click to expand
Figure 6.6: Select Window/Close Perspective to close the current perspective.

Closing this perspective will return you to the previous perspective, in this case the Java perspective. Note that the Debug perspective icon is no longer on the perspective bar.

click to expand
Figure 6.7: And now you're back to the Java perspective.

Now that you've seen most of the pieces of the Eclipse workbench as they relate to simple Java development, I think it's time that to begin a real project.




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