Reputation: 3831
I have a class B
which extends class A
. Now I want to refactor class B
and extract a method to class A
with the Extract Method refactor operation (Alt+Shift+m). Is there any possibility to accomplish this in eclipse?
Thank you :)
Upvotes: 0
Views: 578
Reputation: 32914
Right-click on the method and select Refactor > Pull Up.... There is no keyboard shortcut for that refactoring by default, but you can assign one via the Preferences dialog if you want.
The Extract method refactoring (Alt+Shift+m) does not support creating the new method directly in a super class, so if that's what you're trying to do you'll have to first do the Extract method in class B
and then use Pull Up... refactoring to move it to A
.
Upvotes: 3