简体   繁体   English

如何在 eclipse 中找到 class 的用法?

[英]How do I find usages of class in eclipse?

I am looking for a way to find class occurrences in other classes.我正在寻找一种在其他类中查找 class 出现的方法。 I know I can look for occurrences of a specific method in eclipse: How do I find usages of method implementation in eclipse?我知道我可以在 eclipse 中查找特定方法的出现: 如何在 eclipse 中找到方法实现的用法?

If I select a method and hit "Open Call hierarchy" eclipse shows me all occurrences of this method.如果我 select 一个方法并点击“打开调用层次结构” eclipse 向我显示此方法的所有出现。 I would have expected that this works for classes, too.我本来希望这也适用于课程。 However, this does not work for me.但是,这对我不起作用。 If I have the following scenario:如果我有以下情况:

public class A {
  // ...
}
public class B {

    private A a;
}

I want to find all classes, where my class A is used.我想找到所有使用我的 class A 的类。 Intuitively, I do a right-click on class A and hit "Open Call Hierarchy. However, this does not show me class B, where class A is used.直观地说,我右键单击 class A 并点击“打开调用层次结构。但是,这并没有显示 class B,其中使用了 class A。

Any kind of help is appreciated.任何形式的帮助表示赞赏。

you have to right-click on the class A file - references/Project您必须右键单击 class A 文件 - 参考资料/项目

You can also use Ctrl + Shift + G您也可以使用 Ctrl + Shift + G

EDIT: This answer your question?编辑:这回答了你的问题?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM