IntelliJ IDEA 14.0.0 Web Help

Rename Dialog for a Class or an Interface

Refactor | Rename
Shift+F6

Use this dialog to rename a class or an interface.

In addition to renaming the class or the interface itself, IntelliJ IDEA can also look for the usages of the class or the interface name. If found, the changes you are making to the class or the interface name can also be applied to these usages.

The usages are assigned to different categories which correspond to the options which you can turn on and off.

Note that irrespective of the options selected, the search scope (that is, the places where the name occurrences are looked for) is always limited to the current module and the modules that the current module depends on.

Item Description
Rename <class or interface> and its usages to In this field, specify a new name for the class or the interface.
Search in comments and strings If this option is on, IntelliJ IDEA will look for occurrences of the class or the interface name within comments and string literals in source code files.
Search for text occurrences If this option is on, IntelliJ IDEA will look for occurrences of the class or the interface name in the files that don't contain source code. These may be the text files, properties files, HTML files, documentation files, etc.
Rename variables If this option is on, IntelliJ IDEA will look for occurrences of the class or the interface name in the names of variables. Note that only the variables that have the type of the class or the interface you are renaming will be taken into account.

To illustrate, let's assume that you are renaming the class MyClass and there are the variables MyClass myclass, MyClass myclass20, MyClass m and YourClass myclass25. In such a case, IntelliJ IDEA will suggest to rename the first and the second of the variables but won't suggest to rename the third and the fourth.

Rename inheritors If this option is on, IntelliJ IDEA will look for occurrences of the class or the interface name in the names of its inheritors:
  • If you are renaming a class, IntelliJ IDEA will search the hierarchies of the classes that extend this class.
  • If you are renaming an interface, IntelliJ IDEA will search the hierarchies of the interfaces that extend this interface and the hierarchies of the classes that implement this interface.
Rename tests If this option is on, IntelliJ IDEA will look for occurrences of the class name in the names of the test classes.
Rename bound forms This option is available if the class you are renaming has an associated GUI form.

Select this check box to rename the associated form.

Note that IntelliJ IDEA remembers the latest settings in this dialog. So, each next time you use this dialog, these settings are restored.

See Also

Procedures:

Reference:

Web Resources:

Last modified: 4 December 2014
comments powered by Disqus