Java Eclipse - 找到所有扩展接口的类
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1573491/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse - find all classes that extend interface
提问by Marcus Leon
We have an interface that has a child interface. Ie:
我们有一个接口,它有一个子接口。IE:
public interface GenCalculator extends Serializable {}
public interface SpecialCalculator extends GenCalculator {}
In Eclipse, how can you find all interface-s that extend in this case GenCalculator
?
在 Eclipse 中,如何找到在这种情况下扩展的所有接口GenCalculator
?
If I right click, select "Open Type Hierarchy" in the GenCalculator
interface, I only see classes that implement that GenCalculator
interface. I want to see everything - those that implement and those that extend.
如果我右键单击,在GenCalculator
界面中选择“Open Type Hierarchy” ,我只会看到实现该GenCalculator
界面的类。我想看到一切——那些实现的和那些扩展的。
We're on Eclipse v.3.2.2.
我们使用的是 Eclipse v.3.2.2。
采纳答案by Michael Easter
Ctrl+Tto view all descendants
Ctrl+T查看所有后代
Press it the combination a second time (see fine print in initial popup) if you want to display super interfaces/classes.
如果要显示超级接口/类,请再次按下它的组合(请参阅初始弹出窗口中的细则)。
回答by Dean J
Ctrl+Hbrings up the search, go to Java search, and click "All Occurrences".
Ctrl+ 调H出搜索,转到 Java 搜索,然后单击“所有出现”。
回答by vdr
Click on GenCalculator
in the editor and press CTRL+T
. You will see the quick complete hierarchy.
GenCalculator
在编辑器中单击并按CTRL+T
。您将看到快速完整的层次结构。
It is possible to have that aswell in the "Open Type Hierarchy" view, but you will have to switch the different options (button in the upper right corner).
也可以在“Open Type Hierarchy”视图中使用它,但您必须切换不同的选项(右上角的按钮)。
回答by JuanZe
You can't do it in only one search.
您不能仅通过一次搜索来完成。
May be you could use the "Text Search" option and wildcards, something like searching for "*s YourInterfaceName" (trying to catch "extendsYourInterfaceName" and "implementsYourInterfaceName") but is too tricky.
也许您可以使用“文本搜索”选项和通配符,例如搜索“*s YourInterfaceName”(试图捕获“extend sYourInterfaceName”和“implement sYourInterfaceName”),但太棘手了。
回答by zvikico
You can do it with nWire for Java. However, nWire requires Eclipse 3.3 and above. I highly recommend upgrading.
您可以使用nWire for Java 来实现。但是,nWire 需要 Eclipse 3.3 及更高版本。我强烈建议升级。
回答by Dean Moses
You CAN do this, but it doesn't involve the Type Hierarchy.
您可以这样做,但它不涉及类型层次结构。
In the Eclipse editor pane, highlight the name of the class of which you want to find extending classes.
在 Eclipse 编辑器窗格中,突出显示要查找其扩展类的类的名称。
Then go to Search > Java Search and the name of that class should be prepoplated in the search field.
然后转到“搜索”>“Java 搜索”,该类的名称应预填充在搜索字段中。
Check the 'Limit To > Implementors' radio button.
选中“限制到 > 实施者”单选按钮。
Click the Search button.
单击搜索按钮。
回答by Harun ERGUL
Move your mouse on the class name and press CTRL+T
将鼠标移到类名上并按 CTRL+T