Java Reference
In-Depth Information
Copy
also now works inside lookup lists, such as those that appear on
Ctrl+N
or during code completion. Any selected item in the list can be copied to the clip-
board via
Ctrl+C
shortcut and then pasted, say, in the editor, even as a fully qual-
ified name (if appropriate).
A new command,
Copy Reference
(
Ctrl+Alt+Shift+C
) from the
Edit
or pop-
up menu, lets you place a logical copy of a symbol (such as a method, variable, or
class) into the clipboard. When you later paste the reference, perhaps into
another source file,
IDEA
correctly references the original symbol, adding the
necessary class or package qualifiers as required.
2.2.9
Searching for and replacing text
Like any good editor,
IDEA
provides extensive search and replace capabilities.
However, many of the situations in which you're used to using search and replace
have been made obsolete by
IDEA
's refactoring features. For example, refactoring
lets you rename methods, variables, and even entire classes, while automatically
correcting all references to them. We'll talk about refactoring in chapter 9.
Performing an incremental search
The most basic (and, some say, handiest) of
IDEA
's search commands is the incre-
mental or
type-ahead
search. It's really more of a navigation feature than a search
feature. This type of search lets you jump to a matching term in the current doc-
ument. To begin a search, choose the
Search |
Incremental Search
command
(
Alt+F3
).
You won't see a proper dialog box, only a little
Search for
floating prompt.
Begin typing the word or phrase you want to find: With each keystroke, the search
is updated, instantly taking you to the next match within the current file. If no
more matches are available, the search term changes from black to red. If the
search term is black, there are additional matches; you can use the
Up
and
Down
arrow keys to move between the search results. You can press
Escape
or any navi-
gation key to stop the search.
By the way, a form of incremental search also works in many other areas of
IDEA
, such as the
Project
window: just start typing to activate it.
To repeat the last incremental search, press
Alt+F3
twice in succession.
The first press brings up the search prompt, and the second recalls the
last search term.
TIP