简体   繁体   English

如何找到Java项目中使用方法的位置

[英]How to find where a method is used in Java project

I am working on learning a project which was already created by someone else. 我正在研究别人已经创建的项目。 It was not followed a proper coding method (no comments and so on). 没有遵循正确的编码方法(没有注释等)。 Im finding it difficult to find where a method is used. 我发现很难找到在哪里使用一种方法。 I tried "find" but as it searches only a particular class im unable to get the answer. 我尝试“查找”,但由于它仅搜索无法获得答案的特定类。 Im working in eclipse. 我在日食中工作。 So can anyone please help me out. 所以任何人都可以帮助我。

You can select method that you want to find and use "Ctrl +H" and references search. 您可以选择要查找的方法,然后使用“ Ctrl + H”并引用搜索。 在此处输入图片说明

I hope this can help you. 希望对您有所帮助。

Right click on the method in the editor, and from the pop-up menu select 右键单击编辑器中的方法,然后从弹出菜单中选择

  • References > Project , or 参考 > 项目 ,或者
  • References > Workspace , 参考 > 工作区

depending on whether you want to search only in the current project, or in the entire workspace. 取决于您只想在当前项目中还是在整个工作空间中进行搜索。

For the find references in workspace option, the default keyboard shortcut is: Shift + Ctrl + G 对于在工作空间中查找引用选项,默认键盘快捷键是: Shift + Ctrl + G

After invoking the command, the Search window will display an overview of all locations where the method is used. 调用命令后,“ 搜索”窗口将显示使用该方法的所有位置的概览。

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

相关问题 找出Java / Eclipse项目中特定包的类在哪里使用 - Find out where classes of a specific package are used in Java/Eclipse project 如何找出在Java中调用该方法的位置? - How to find out where the method was called in Java? 如何找出在项目中调用System.getProperty()方法的位置? - How to find out where System.getProperty() method is invoked in the project? Java查找在代码中使用类的位置-以编程方式 - Java find where a class is used in the code - programmatically 如何在参数为复合表达式的Java代码中查找方法的用法? - How to find the usage of method in Java code where the arguments are compound expressions? Java 中如何以及在哪里使用注解? - How and where are Annotations used in Java? 如何在java项目中找到哪个数据类没有覆盖toString()方法 - How to find which data class not overriden toString() method in java project 如何在大型Java项目中查找静态方法调用? - How to find static method calls in large Java project? 如何以编程方式查找项目中的所有Java方法调用和给定参数? - How to find all Java method calls and given parameters in a project programmatically? 如何找到在 Android Studio 中使用方法或变量的位置(快捷方式) - How can i find where a method or a variable is used in Android Studio (shortcut)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM