Java Reference
In-Depth Information
your code's structure dynamically, so it understands a variable reference when it
sees it. This lets you navigate using the code structure, following method calls and
other code elements to take you where you want to go.
3.3.1
Navigating between methods
Because Java classes are largely composed of a number of methods, it's conven-
ient to jump around the file method by method. You can quickly jump to the start
of the next method in the editor by selecting Go To | Next Method or pressing
Alt+Down . Conversely, Go To | Previous Method ( Alt+Up ) can be used to go
the other direction, toward the beginning of the file.
In the Editor settings, enable the Show method separators option to
add a line graphic between each method in the editor. Doing so provides
a visual indication of where each method begins and ends.
TIP
3.3.2
Navigating to a symbol's declaration
In Java, a code symbol is any named code reference—for example, a method or
instance variable. When you're working in the editor, it's often handy to navigate
back to where the symbol was first declared, making it easy to understand its
place in the world and its relevance to the rest of the code. In the editor, you can
jump back to the initial declaration of a symbol with the Go To | Declaration
command ( Ctrl+B ). You can use this command anywhere a symbol is referenced,
even from inside another class or within JavaDoc comments. You can use this fea-
ture with any of the Java code symbols:
Methods
Classes
Instance variables
Class variables
Local variables
Method parameters
A related command, Go To | Type declaration ( Ctrl+Shift+B ), takes you to the
declaration of the symbol's type rather than the symbol itself. (This command has
no effect on symbols that reference any of the primitive types.) For example, let's
presume that the class FixedRateCurrencyExchangeService has an instance vari-
able named defaultCurrency , which holds an object of type Currency . If you move
the cursor to any usage of the defaultCurrency variable and execute the Go To |
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search