How can I implement an interface using the keyboard only?

Hi,
I have a Java interface and want to implement it with a class.

There's a nice CtrlShiftE shortcut to extend it with another interface.
Is there something similair to implement it with a class instead?

Thanks,
Joe

(Using 7.04)

4 comments
Comment actions Permalink

Hello wallaby.pouch,

I have a Java interface and want to implement it with a class.
There's a nice CtrlShiftE shortcut to extend it with another
interface. Is there something similair to implement it with a class
instead?


Put the caret on the interface name, press Alt-Enter and select "Implement
Interface" from the context menu.

The Ctrl-Shift-E shortcut is provided by a third-party plugin (Lineage?)
- it's not part of IDEA core.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Dmitry,
thanks a lot for your reply.
The "implement interface" intention sounds great.

I forgot to mention that I'm working in the project view sidebar. I don't have source code which uses the interface yet as I'm currently doing the basic implementations of several interfaces.

To implement an interface I right-click on a package in the project view, select new->class from the menu, enter the name and add the "implements MyInterface" in the new Java file. I do that quite often.

Do you know a simpler way to do this?

Thanks,
wallaby.pouch

0
Comment actions Permalink

Never mind, found a fix.
Did not notice that alt+enter works on the interface itself.

Wallaby

0
Comment actions Permalink

Hello wallaby.pouch,

The "implement interface" intention sounds great.
I forgot to mention that I'm working in the project view sidebar. I
don't have source code which uses the interface yet as I'm currently
doing the basic implementations of several interfaces.

To implement an interface I right-click on a package in the project
view, select new->class from the menu, enter the name and add the
"implements MyInterface" in the new Java file. I do that quite often.

Do you know a simpler way to do this?


No, at the moment there's no simpler way to do this (unless you're using
some third-party plugins). A JIRA issue is welcome.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.