Java Reference
In-Depth Information
Replacing text across a project
The command
Search | Replace in Path
(
Ctrl+Shift+R
) works similarly to the
Replace
command discussed earlier in terms of replacing matches and like the
Find in Path
operation in terms of the results window it returns. As before, you
see all the matches in the
Find
window, but you're taken to the first match and
immediately prompted with a dialog that offers the following options:
Replace
replaces the current match with the replacement text you've spec-
ified and moves to the next match.
■
Skip
moves on to the next match, leaving the current one unchanged.
■
All in This File
replaces all matches in the file containing the current
match and open in the editor with your replacement text, and moves on to
the next file with matches.
■
All Files
replaces all matches across all files.
■
Cancel
closes this replacement dialog and returns to the
Find
window.
■
From this dialog, it would appear that you have three choices: step through each
match one by one, replace everything, or replace nothing. If you have many
results, you'll be glad to hear that there is a more selective (and faster) way of pro-
cessing your replacement selections. When you close the replacement dialog and
return to the
Find
window, three buttons appear at the bottom of the window:
Do Replace All
replaces all nonexcluded matches. You may exclude any
subset of the found files that you wish, including entire packages, classes,
or methods. Items can be excluded from the context menu or by selecting
them and pressing
Delete
.
■
Replace Selected
performs a replacement on the currently selected
matches.
■
Cancel
aborts the entire process. Any replacements youve already accepted
remain replaced, but you can use the Undo operation to revert them.
■
2.3 Summary
IDEA
's editor is a full-featured editor with most of the functionality you expect to
find in any world-class editing package. It supports such features as tabbed-file
editing, tab grouping, a recent file list, and the like. In addition,
IDEA
uses the
gutter and the marker bar to provide real-time information about the state of
the edited file, providing useful features that are uncommon in other editing