| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html lang="en"> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <title> |
| Using the Java browsing perspective |
| </title> |
| <script language="JavaScript" type="text/javascript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script> |
| </head> |
| <body> |
| <h1> |
| Using the Java browsing perspective |
| </h1> |
| <p> |
| In this section you will use the Java browsing perspective to browse and |
| manipulate your code. <a href="qs-4.htm">Browsing Java elements with the |
| Package Explorer</a> gives an overview of using the Package Explorer to browse |
| elements. In contrast to the Package Explorer, which organizes all Java elements |
| in a tree, consisting of projects, packages, compilation units, types, etc., the |
| browsing perspective uses distinct views to present the same information. Selecting |
| an element in one view, will show its content in another view. |
| </p> |
| <p>To open a browsing perspective activate |
| <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.jdt.ui.JavaBrowsingPerspective)")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png" alt="Open the Java browsing perspective"> |
| <strong>Window > Open Perspective > Java Browsing</strong></a> from |
| within the Java perspective or use the context menu of the <strong>Open a Perspective |
| </strong> toolbar button. |
| </p> |
| <p> |
| <img src="images/workbench_java_browsing.png" alt="Java browsing perspective"> |
| </p> |
| <p> |
| The views of the perspective are connected to each other in the following ways:</p> |
| <ul> |
| <li> |
| Selecting an element in the <strong>Projects</strong> views shows its packages |
| in the <strong>Packages</strong> view. |
| </li> |
| <li> |
| The <strong>Types</strong> view shows the types contained in the package selected |
| in the <strong>Packages</strong> view. |
| </li> |
| <li> |
| The <strong>Members</strong> view shows the members of a selected type. Functionally, |
| the <strong>Members</strong> view is comparable to the <strong>Outline</strong> view used in the normal Java |
| perspective. |
| </li> |
| <li> |
| Selecting an element in the <strong>Members</strong> view reveals the element in the editor. If there |
| isn't an editor open for the element, double-clicking on the element will open a corresponding editor. |
| </li> |
| </ul> |
| <p> |
| All four views are by default linked to the active editor. This means that the views will adjust |
| their content and their selection according to the file presented in the active editor. The |
| following steps illustrate this behavior:</p> |
| <ol> |
| <li> |
| Select <em>junit.extensions</em> in the <strong>Packages</strong> view. |
| </li> |
| <li> |
| Open type <em>TestSetup</em> in the editor by double-clicking it in the <strong>Types view</strong>. |
| </li> |
| <li> |
| Now give back focus to the editor opened on file <em>TestCase.java</em> by clicking on the |
| editor tab. The <strong>Packages</strong>, <strong>Types</strong> and <strong> |
| Members</strong> view adjust their content and selections to reflect the active editor. The |
| <strong>Packages</strong> view's selection is set to <em>junit.framework</em> and the <strong> |
| Types</strong> view shows the content of the <em>junit.framework</em> packages. In addition, |
| the type <em>TestCase</em> is selected. |
| </li> |
| </ol> |
| <p> |
| Functionally, the Java browsing perspective is fully comparable to the Java perspective. |
| The context menus for projects, packages, types, etc. and the global menu and tool bar are the same. |
| Therefore activating these functions is analogous to activating them in the Java perspective. |
| </p> |
| <P class="nav_footer" id="nav_footer">Next Section: <A href="qs-junit.htm">Writing and running JUnit tests</A> |
| </P> |
| </body> |
| </html> |