You can rename classes or any file by hitting F2 on the filename in Eclipse. It will ask you if you want to update references. It's really as easy as that :)
To rename file using refactoring (which also updates all occurrences of name in other scripts):
See "PHP Developer User Guide > Tasks > Using Refactoring > Renaming Files".
Just rename the class in the source code.
Eclipse will point out an error by underlining the class name with a red squiggly line.
Hover on that line with your mouse pointer and eclipse will give you the option to rename compilation unit
.
Click on that.
Shift + Alt + r (Right click file -> Refactor -> Rename) when cursor is on class name. The file and constructors will be also changed.
Simply select the class, right click and choose rename (probably F2 will also do). You can also select the class name in the source file, right click, choose Source, Refactor and rename. In both cases, both the class and the filename will be changed.
Click on the class and press the Alt + Shift + R
keys, then you can change it to the required name and the corresponding file name will also be changed.
Right click file -> Refactor -> Rename.
Right click on the class->select Refactor->Rename
I found the answers above didn't give me the guidance I needed (I too expected to be in the code for the .java file, and right-click on the tab and see a Refactor option). Here's what I did:
Source: Stackoverflow.com