Reputation: 28188
Is there a straightforward way to find references in my code to a class in an external library (jar without source) if I don't already have a file open that has a reference to the class?
For instance, say I want to find all references in my code to System.out.println()
but I don't already have code open that uses println
. How can I do this?
Upvotes: 1
Views: 358
Reputation: 18869
It would be possible to do this using a File Search
. Press Ctrl + H and put in System.out.println
. Adjust the scope of the search according to your needs (I usually set it to Enclosing Project
or Selected Resource
).
Upvotes: 0
Reputation: 32914
You can open any type (class or interface) via Ctrl+Shift+T (Command+Shift+T on a Mac). When the class/interface source opens, select a method or field (instance variable) in that class, right-click, and choose References.
If you don't have the source code, you'll see the Class File Editor, "Source not found" window. If you don't already have the "link with editor" icon enabled, either enable it or select the Navigate menu, Show In, Package Explorer. Then in the package explorer, select a method or field (instance variable) in that class, right-click, and choose References.
Upvotes: 1
Reputation: 28188
The only way I know to do this is to perform the following (not exactly straightforward) sequence:
System.out.println()
ctrl-shift-o
)println
and type ctrl-shift-g
or search, references, workspace.Upvotes: 0