How to find usages using Eclipse IDE?

后端 未结 7 1378
逝去的感伤
逝去的感伤 2020-12-25 09:49

I have following code:

public class MyClass{
   ...
}

At same workspace I have following class

public class AnotherClass{
          


        
相关标签:
7条回答
  • 2020-12-25 10:09

    PC:

    1. Select a word (class name, method name, variable name, etc.)
    2. Press Ctrl+Shift+G

    Mac:

    1. Select a word (class name, method name, variable name, etc.)
    2. Press Alt+Cmd+G (++G)
    0 讨论(0)
  • 2020-12-25 10:12

    To my knowledge, both of Ctrl+Shift+G and Ctrl+Alt+H should work.

    For Your Information:

    Ctrl+Shift+G --> is the short key for Search --> References --> workspace

    Ctrl+Alt+H --> is the short key for Call hierarchy.

    0 讨论(0)
  • 2020-12-25 10:18

    For your case, I think both of (Ctrl +Shift+G) and (Ctrl +Alt+H) work.

    To make it more clear:

    • (Ctrl +Shift+G) is shortkey for Search->References->workspace

    • Ctrl +Alt+H is short key for Call hierarchy.

    Some other useful short keys like:

    • (Ctrl+G) : Search->Declaration->worksapce
    • (Alt+Left) : Back position
    • (Alt+Right) : Forward position
    0 讨论(0)
  • 2020-12-25 10:19

    Try right-click on MyClassand then References->Workspace. I think this might be what you're looking for.

    Also works on methods, variables etc.

    0 讨论(0)
  • 2020-12-25 10:21

    Right click on Myclass, find references in project|workspace.

    Open call hierarchy, open inheritance hierarchy.

    0 讨论(0)
  • 2020-12-25 10:26

    Select the resource (method name, class name ) & right click . You will find a menu with title 'Open Call Hierarchy' (shortcut key : alt + Ctrl + H ). This will enlist all the usage in project.

    0 讨论(0)
提交回复
热议问题