@NotNull @Override public PsiJavaCodeReferenceElement createClassReferenceElement(@NotNull final PsiClass aClass) { final String text; if (aClass instanceof PsiAnonymousClass) { text = ((PsiAnonymousClass) aClass).getBaseClassType().getPresentableText(); } else { text = aClass.getName(); } return new LightClassReference(myManager, text, aClass); }
@NotNull @Override public PsiReferenceExpression createReferenceExpression(@NotNull final PsiClass aClass) throws IncorrectOperationException { final String text; if (aClass instanceof PsiAnonymousClass) { text = ((PsiAnonymousClass) aClass).getBaseClassType().getPresentableText(); } else { text = aClass.getName(); } return new LightClassReferenceExpression(myManager, text, aClass); }
@NotNull @Override public PsiJavaCodeReferenceElement createClassReferenceElement(@NotNull final PsiClass aClass) { final String text; if (aClass instanceof PsiAnonymousClass) { text = ((PsiAnonymousClass) aClass).getBaseClassType().getPresentableText(); } else { text = aClass.getName(); } if (text == null) { throw new IncorrectOperationException("Invalid class: " + aClass); } return new LightClassReference(myManager, text, aClass); }