Geertjan's Blog

  • October 25, 2011

Super Fast Navigation From Java Interface To Implementations

Geertjan Wielenga
Product Manager

Here's a Java interface open in NetBeans IDE:

Today (in fact, 5 minutes ago) I discovered (while looking at http://netbeans.org/bugzilla/show_bug.cgi?id=150342), that you can click on the "I" icons in the sidebar above and then...

Wow. I can click on an item in the list above and then I find myself in the selected implementation. So, I can navigate from an interface to any of its implementations by clicking on the "I" icon on the left of a Java interface?

Is it just me or is that a really hidden feature? (Should it be signposted better? I always knew what the icon meant but not that you could click on it and so I've never clicked on it before.) Or has everyone out there using NetBeans IDE been happily using this feature for many years? (Or is it new in 7.1?)

Join the discussion

Comments ( 9 )
  • Jesse Glick Tuesday, October 25, 2011

    Been there for a long time; I use this action quite frequently (usually on an overridden/implemented method but sometimes on the whole type). Ctrl-Alt-B works from the keyboard.

  • guest Tuesday, October 25, 2011

    A colleague showed this to me only a few weeks ago. It is really useful when navigating through a class hierarchy. Oh yeah, and it works in the other direction as well!

  • guest Tuesday, October 25, 2011

    I first saw this on a Tor Norbye blog - before he moved on. It was certainly there in 6.9, and possibly earlier. Very very very useful.

  • Tóth Gábor Wednesday, October 26, 2011

    You can use Ctrl+Alt+Left button click elsewhere in the source not only at the interface definition but also at an interface method call.

  • guest Wednesday, October 26, 2011

    You blog kicks ass Geertjan!

  • guest Wednesday, October 26, 2011

    Your blog is awesome!

    Long live Geertjan, NetBeans IDE, Java, Swing and [the Sun division of] Oracle!

  • Derek Witt Wednesday, October 26, 2011

    I usually use Control-Alt-H ("Find Usages" and then on "Find X Sub-Types").

    That just lists the classes that implement said interface/abstract class.

    The feature you're describing is news to me. That would be very handy to use. It's not in 6.0.1, but available in 7.0.1+.

    The reverse (going up the hierarchy) is also available as a tip.

    Another way to show this hierarchy is "Navigate | Inspect | Show Hierarchy." (Available in NB 6.0.1+).

  • Fabrizio Giudici Wednesday, October 26, 2011

    LOL, Geertjan, I was completely unaware of it too. I've always went the way Derek described. This "new" trick is much faster.

  • Jonathan Spooner Wednesday, October 26, 2011

    Sorry, I have to add myself to the "already knew" group.

    I discovered this through association, that is, I discovered that you can click on the green icon that is beside the @Override annotation next to methods and it will take you to the parent method. Then I thought "what's that little grey icon do I wonder" and there was a nice little list of the implementing classes.

    It's wonderful!

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.