Renaming files

You can rename files.

About this task

Do the following:

Procedure

  1. Right-click on the file and select Refactor > Rename (also Refactor > Rename from the menu or Alt+Shift+R).
  2. In the dialog, specify the new name and the level of refactoring (that is, changing names in the source files to reflect the new file name):
    1. New name - enter a unique name for the file.
    2. Update references - select this box to change names in the source files that match the old file name.
    3. Update similarly named variables and methods - select this box to change variable and method names in the source files that are similar to the old file name. Continue reading for instructions.
    4. Update textual occurrences in comments and strings - select this box to change the name where it occurs in comments and strings.
    5. Update fully qualified names in non-Java text files.
  3. If you elect to update similarly named variables and methods, click Configure to specify the level of similarity. You are presented with another dialog with the following options:
    1. Find exact names only (selected by default) - for example, if the file name is SomeClass.java, this option finds SomeClass and SomeClass().
    2. Also find embedded names (not selected by default) - for example, this options finds mySomeClassToUse and getSomeClass().
    3. Also find name suffixes (not selected by default) - for example, this option finds class, myClass, and getClassToUse.