Using the Java browsing perspective

In this section you will use the Java browsing perspective to browse and manipulate your code. Browsing Java elements with the Package Explorer 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.

To open a browsing perspective activate Open the Java browsing perspective Window > Open Perspective > Java Browsing from within the Java perspective or use the context menu of the Open a Perspective toolbar button.

Java browsing perspective

The views of the perspective are connected to each other in the following ways:

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:

  1. Select junit.extensions in the Packages view.
  2. Open type TestSetup in the editor by double-clicking it in the Types view.
  3. Now give back focus to the editor opened on file TestCase.java by clicking on the editor tab. The Packages, Types and Members view adjust their content and selections to reflect the active editor. The Packages view's selection is set to junit.framework and the Types view shows the content of the junit.framework packages. In addition, the type TestCase is selected.

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.