コード例 #1
0
 @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);
 }
コード例 #2
0
 @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);
 }
コード例 #3
0
 @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);
 }