简体   繁体   English

在Eclipse中,是否可以找到在哪里调用了某个函数,类或变量?

[英]In Eclipse, is it possible to find, where, a certain function, class or variable is called?

When you want to open the declaration of a class/function/variable in java you can press Ctrl and click on it, but is there are way to go the other way round? 当您想在Java中打开类/函数/变量的声明时,可以按Ctrl并单击它,但是还有其他方法吗? If you had to find all instances where a function or variable is called how would you quickly get that? 如果必须查找所有调用了函数或变量的实例,您将如何快速获得该实例?

Ctrl + Alt + H向您显示使用或调用变量或方法的所有位置。

On both Windows and Mac, right-click the method, and choose "Open Call Hierarchy." 在Windows和Mac上,右键单击该方法,然后选择“打开呼叫层次结构”。

You can use this for identifiers other than methods. 您可以将其用于方法以外的其他标识符。 For example, if a class does not have an explicit constructor, you can use this to find all the callers of its default constructor. 例如,如果一个类没有显式的构造函数,则可以使用它来查找其默认构造函数的所有调用方。

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

相关问题 找到在Eclipse中实例化类的位置? - Find where a class is instantiated in Eclipse? 在Eclipse中,是否可以在项目中找到采用某种参数类型的所有方法? - In Eclipse, is it possible to find all methods in project that take a certain parameter type? 是否可以获得类 2 的实例,其中调用了类 1 的构造函数? - Is it possible to get instance of a class 2 where constructor of class 1 was called? 是否可以在运行时扫描程序包层次结构以查找调用方法的位置? - Is it possible to scan a package hierarchy at runtime to find where a method is called? 是否有可能找到在eclipse中捕获特定抛出异常的位置? - Is it possible to find where a specific thrown exception could be caught in eclipse? 如果直接或间接地从另一个方法调用某个方法,如何在Eclipse中查找? - How to find out in Eclipse if certain method is called from another method directly or indirectly? 如何查找所有未在Eclipse中评估函数返回值的实例? - How to find all instances where function return value is not evaluated in Eclipse? Eclipse无法找到变量 - Eclipse Unable To Find Variable 是否可以检查是否调用了函数? - Is it possible to check, if a function was called? 如何在Eclipse中的类中查找和删除函数的所有出现? - How to find and remove all occurances of a function in a class in Eclipse?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM