String (PsiElement position) { if (position.getParent() instanceof PsiJavaCodeReferenceElement) { PsiElement grand = position.getParent().getParent(); if (grand instanceof PsiJavaCodeReferenceElement && ((PsiJavaCodeReferenceElement)grand).getQualifier() == position.getParent()) { return ((PsiJavaCodeReferenceElement)grand).getReferenceName(); } } return null; }