Java Reference
In-Depth Information
Figure 9.9
The Structural Search and
Replace command lets you
perform search and replace
operations on logical
structures of code. It's
effectively a template-
based Java-aware search
and replace.
operation, you'd type the word or phrase you're searching for; here, however,
you specify a fragment that describes the code. This is called a
search template
.
Below the
Search template
text box are a number of options and settings:
Save template
allows you to save the current search template for later
reuse via the
Copy existing template
button.
■
Edit variables
lets you edit variable references within the search template.
■
History
accesses a list of recent searches so you can reapply them.
■
Copy existing template
accesses a library of dozens of search templates
bundled with
IDEA
, or templates you've saved yourself through the
Save
template
button.
■
Recursive matching
enables a structural search in the search results,
recursively. For example, if you search for classes,
IDEA
will also look for
classes inside those it finds.
■
Case sensitive
determines whether two letters match if they differ only
in case.
■
Maximum matches
limits the number of matches to the specified amount.
■
Scope
limits the search to certain subsets of files with the project.
■
Working with search templates
The essence of
SSR
lies in creating the search template. A search template works
similarly to the live templates already discussed. It consists of code fragments