Eclipse Refactor Menu
Using Eclipse refactoring
In project development, we often need to change a class name, but when other classes depend on that class, we need to spend a lot of time changing the class name.
But Eclipse's refactoring feature can automatically detect class dependencies and change the class name, saving us a lot of time.
You can open the refactor menu in the following ways:
- Right-click a Java element in the Package Explorer view and select the Refactor menu item
- Right-click a Java element in the Java editor and select the Refactor menu item
- Select a Java element in the Package Explorer view and press Shift + Alt + T
In the figure below, we have selected the HelloWorld class in the Java editor:
After selecting Rename, you will be prompted to enter a new class name and press Enter to finish the change:
After pressing Enter to complete the change, the classes to be modified will pop up:
You only need to click the Continue button to complete the operation.