Open Implementation (type hierarchy) functionality in NetBeans?
Asked Answered
S

5

7

When I have Java code like this:

someInterface.someMethod();

how do I get Netbeans to show me which classes have implementations of someMethod() (not the interface).

In Eclipse this is done with Ctrl+T, but pressing Ctrl+T on the method did nothing in Netbeans 6.5 and I can't where the type hierarchy functionality is in Netbeans 6.5.

Thanks.

Stockbroker answered 27/8, 2009 at 17:2 Comment(0)
S
5

This functionality already exists in Netbeans: Alt+F7, check 'Find All Subtypes', and click OK. Thanks to tkellerer for pointing this out on the Netbeans forums

http://forums.netbeans.org/viewtopic.php?p=49638#49638

This is widely overlooked functionality in Netbeans, perhaps because there is no key binding for it, so I've changed my enhancement request to add a key binding for the sequence "Alt+F7, check 'Find All Subtypes', and click OK"?

Stockbroker answered 24/9, 2009 at 23:37 Comment(1)
I know this is an old post but I have never found that Netbeans 'find implementations' works reliably and I wonder whether it has to do with the context the function is used in. For example do projects in which implement the interface need to be open? I work with a lot of OSGi bundles and very rarely does this function work in Netbeans and it's something that would be extremely useful in that context.Isopropyl
L
10

I find that Ctrl+Alt+B works perfectly. :)

Lunnete answered 12/4, 2012 at 7:16 Comment(1)
This is the correct equivalent to Eclipse in the newer versions of Netbeans and is better than the "find usages" option.Solangesolano
S
5

This functionality already exists in Netbeans: Alt+F7, check 'Find All Subtypes', and click OK. Thanks to tkellerer for pointing this out on the Netbeans forums

http://forums.netbeans.org/viewtopic.php?p=49638#49638

This is widely overlooked functionality in Netbeans, perhaps because there is no key binding for it, so I've changed my enhancement request to add a key binding for the sequence "Alt+F7, check 'Find All Subtypes', and click OK"?

Stockbroker answered 24/9, 2009 at 23:37 Comment(1)
I know this is an old post but I have never found that Netbeans 'find implementations' works reliably and I wonder whether it has to do with the context the function is used in. For example do projects in which implement the interface need to be open? I work with a lot of OSGi bundles and very rarely does this function work in Netbeans and it's something that would be extremely useful in that context.Isopropyl
D
1

To get a hierarchy similar to the type hierarchy in Eclipse, right click on the class name, select Navigate, and then Inspect Hierarchy. The keyboard shortcut for this is ALT+SHIFT+F12. By default, it shows you parents of the selected class or interface. However, you can view descendants by using the Filters at the bottom left side. I believe the Show Subtype Hierarchy filter (also toggled by using CTRL+B) is what you want.

This is accurate in NetBeans 6.7.1. I'm going to assume it is similar in 6.5.

Diaeresis answered 31/8, 2009 at 19:7 Comment(1)
You've misunderstood my question. I have an interface and want to see which implementations are available for a method of the interface. Eclipse shows me the various implementations, ALT+SHIFT+F12 doesn't do anything for an interface in Netbeasn 6.5.1.Stockbroker
S
0

It turns out that there is no comparable functionality in Netbeans. You can read about it here:

http://forums.netbeans.org/viewtopic.php?p=49355#49355

I've also filed an enhancement request here, which you can vote for:

http://www.netbeans.org/issues/show_bug.cgi?id=172830

If you want to see this added to Netbeans please vote for it.

Stockbroker answered 23/9, 2009 at 3:18 Comment(0)
O
0

Hey, someone has implemented a module to do this, and it works in Netbeans 6.5.1 - perfect for you. I'm hanging out to see an equivalent for 6.7.1. Maybe they should add it to 6.8!

http://wiki.netbeans.org/JavaGoToImplementation

Go To Implementation is built in for recent versions of NetBeans. Look in the Navigate context menu.

Orangewood answered 6/12, 2009 at 23:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.