Finding Class, Method, and Field Usages

See Also

You can use the Find Usages command to determine everywhere a class, method, or field is used in your project's source code.

To find where a class, interface, method, or field is used in your project:

  1. In the Projects window or the Source Editor window, right-click the code element and choose Find Usages (Alt-F7).
  2. In the Find Usages dialog box, select options for the scope of the search.

    See the following sections of this topic for more information on the Find Usages command and its options.

  3. Click Next.

    The Usages window displays the file name and the line of code for each usage found in that file.

To jump to a specific occurrence of the code element, do one of the following actions:

Classes and Interfaces

For classes and interfaces, the Find Usages command displays all the code lines that:

After you choose the Find Usages command on a class or interface, the Find Usages dialog box might give you additional options:

Methods

For methods, the Find Usages command displays the code lines that:

After you choose the Find Usages command on a method, the Find Usages dialog box might give you additional options:

Fields

For fields, the Find Usages command displays all the code lines that:

Additional IDE Find Mechanisms

The other IDE tools that enable you to search for all the places where specific text is used in a project include:

See Also
Refactoring: Quick Reference
Renaming a Class or Interface
Renaming a Field or Method
Safely Deleting Java Code
Undoing Refactoring Changes

Legal Notices