Find class in 12.1.4

I have full class name and I need to find PsiClass for it.
In this question it is said to use PsiManager.getInstance (i_project).findClass
I use Idea 12.1.4 and i don't see findClass method in PsiManager.
How can i dind PsiClass?

After the class is found i need to open editor on it and scroll cursor to some field declaration.
How can i do it?

3 comments

Hi,

I make use of the JavaPsiFacade class to find a PsiClass instance by a fully qualified name;

For instance

        final PsiClass psiClass = JavaPsiFacade.getInstance(project)
                .findClass("java.lang.Throwable", GlobalSearchScope.allScope(project));


Hopefully that helps you with the first part :)

Cheers
Alan

0

Thanks, and for second part I found in GotoRelatedItem

PsiNavigateUtil.navigate(element)

0

Please sign in to leave a comment.