如何在Eclipse中找到方法实现的用法? [英] How do I find usages of method implementation in eclipse?

查看:57
本文介绍了如何在Eclipse中找到方法实现的用法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想在Java中找到普通方法的用法时, CTRL-SHIFT-G 非常简单明了.

When I want to find usages of a normal method in java it is fairly easy and straightforward CTRL-SHIFT-G .

但是,如果此方法具有 super 定义或实现,则eclipse将向我显示层次结构类型中所有类型的用法.

However if this method has a super definition, or implementation, then eclipse will show me usages of all types in the hierarchy types.

例如,如果我的课程上有一个 toString()方法,那么我只会对查找该类的toString()的确切位置感兴趣,而eclipse可以让我得到项目中的单个祖先toString(即 Object.toString()).

For example, if I have a toString() method on my class, I would only be interested in finding exactly where this toString() of this class was being called, instead eclipse gives me every single ancestor toString in the project (ie Object.toString()).

如何仅找到班上的特定用法?而不是使用 Object.toString()之类的父类吗?

How do I find only specific usages to my class? And not usages of parent classes like Object.toString() ?

推荐答案

Alt + ctrl + h 应该可以为您提供所需的确切信息.

Alt + ctrl + h should give you exactly, what you are looking for.

使用我的工作区中的屏幕截图进行了更新,因为有些人在关注它时遇到了问题:

Updated with screenshot from my workspace as some people are facing issue in following it:

这篇关于如何在Eclipse中找到方法实现的用法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆