Refactor Interface -- add method?

Is there a way to add a new method to an existing interface and have
intelliJ insert method stubs into the implementing classes?

I don't see this on the Refactor menu.

Thanks,

Ted

3 comments
Comment actions Permalink

You might get away with adding the method to the interface, using Push
Members Down and then re-adding the method to the interface. However I
think this should be a feature of IDEA somehow.

Ted Hill wrote:

Is there a way to add a new method to an existing interface and have
intelliJ insert method stubs into the implementing classes?

I don't see this on the Refactor menu.

Thanks,

Ted

0
Comment actions Permalink

Hello Ted,

TH> Is there a way to add a new method to an existing interface and have
TH> intelliJ insert method stubs into the implementing classes?

There is a quickfix "Implement Method" that allows you to implement a method
in a single class implementing the interface. You can use it repeatedly to
generate implementations in all classes.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink


What about

1. adding the method to one of the classes that implements the method.

2. using pull "members up" to 'move' the method to the interface.

Will this then add stubs to the other classes that implement the interface?

0

Please sign in to leave a comment.