Rename Dialog Box
See Also
Use this dialog box to specify options for the Rename refactoring command.
You can use the Rename command to give a new name to a Java identifier
and have references to that identifier updated with the new name throughout your code.
You can rename classes, methods, and fields.
The Rename dialog box appears after you have done one of the following actions:
- Chosen the Refactor > Rename (Ctrl-R) command while having a Java
identifier selected in the Source Editor, Projects window, or Files window.
- Done an in-place rename of a file
in the Projects window or the Files window.
The Rename dialog box has the following fields:
- New Name. Contains the name of the Java identifier to be renamed.
Specify the new name of the class by modifying this field.
- Apply Rename on Comments. If selected, the rename is also
applied on all occurrences of the name in comments.
Unless you click Refactor, you need to follow these steps
to complete the refactoring:
- Click Preview.
The Refactoring
window opens and displays a tree view of the code to be affected by the refactoring.
- Check the items displayed in the Refactoring window to make sure that you want them
all changed. Clear the checkbox next to any parts of the code that
you do not want changed.
- Click Do Refactoring.
- You should always perform a clean build after completing
any refactoring commands. You can do a clean build by right-clicking the project's
node in the Projects window and choosing Clean and Build Project.
- See Also
- Refactoring: Quick Reference
- Renaming a Class or Interface
- Renaming a Field or Method
- Moving a Class to Another Java Package
- Undoing Refactoring Changes
Legal Notices