Finding the file corresponding to a Java class name
I have a class name such as "com.example.Foo" and want to find the file that defines it within an IDEA project. Basically I want to find the file that you would go to by control-clicking on an import statement, wherever that is. (It might be Java source, or it might come from a library, and if it's in a library, it may or may not have source code attached. If there is source code attached, I want the source.) How do I do that?
- Brian
Please sign in to leave a comment.
Hello Brian,
PsiManager.getInstance(project).getClass().getContainingFile()
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"