- Open the source file containing the interface. Select the interface name and press F4 (Open hierarchy type).
- In the type hierarchy view, select all classes that implement your interface. The hierarchy is displayed as a tree, so the choice should be very simple.
- Right-click your selection, select
Source , then Override/Implement Methods...
Mission Complete.
[Changed]
When I wrote these steps, I thought you intended to stub the recently introduced interface methods in all classes implementing this interface.
Now, when I re-read your request, it is difficult for me to understand exactly what you want to do. You wrote:
how can i add a field, getter and setter to all implementations of MyInterface
So, you have an interface named MyInterface and 1000 classes that implement it. You would like to enter a new field, getter and setter for this field. Therefore, I assume that my (and possibly others) first problem is that you cannot add a field to an interface unless it is final - so your desire to "add a field to an interface" just doesn't sound right.
I suppose this will help if you give us a chart / explanation of your hierarchy at 30,000 feet and what you are trying to accomplish.
source share