Java Reference
In-Depth Information
texism.examples.book
packages, but no code at any other package level, this
option shows only two packages on the tree:
com.texism
and
com.texism.exam-
ples.book
. The
com
and
com.texism.examples
packages are not shown. For all
practical purposes, this option enables package flattening for empty package
structures. This option is only available when you haven't enabled the
Flatten
Packages
option.
Showing and hiding members
Want even more fine-grained access to the items in your project? Enabling the
Show Members
option exposes the methods and fields that belong to each class
listed in the
Project
view, as shown in figure 4.22. Double-clicking a field or
method item in the list loads its class's source file and positions the cursor at the
point the member is declared. This is an excellent way to quickly explore the
structure of your code and navigate right to the method of interest. However, it
takes up a lot of room, so there is the alternative structure view, which we'll get to
in a second.
Configuring autoscrolling to source
Enabling the
Autoscroll to Source
option turns all those double-click navigation
operations we've mentioned into single clicks. Selecting any item in the
Project
window takes you to that item in the editor. It even works with keyboard naviga-
tion: Arrow around the tree, and watch the editor follow you.
The inverse option—
Autoscroll from Source
—provides the opposite func-
tionality: While you navigate your code in the editor, the current semantic item
(class, method, or field) is automatically selected in the
Project
window.
With the
Project
window active, begin typing the name of the class,
method, or field you want to navigate to. The selection automatically se-
lects the next matching item. Then, use the up and down arrows to nav-
igate between matching items.
TIP
Showing class structure
An alternative way to examine class members is handled by the
Show Structure
option. Enabling the
Structure
view adds a panel to the bottom of the
Project
view (as shown in figure 4.23) that exposes the structure of the selected class. This
gives you the ability to navigate directly to a particular method without eating up
the whole window. You can even resize the pane as necessary. For even more