HighlightInfoType (@Nullable PsiClass aClass, @NotNull PsiElement element) { if (element instanceof PsiJavaCodeReferenceElement && element.getParent() instanceof PsiAnonymousClass) { return JavaHighlightInfoTypes.ANONYMOUS_CLASS_NAME; } if (aClass != null) { if (aClass.isAnnotationType()) return JavaHighlightInfoTypes.ANNOTATION_NAME; if (aClass.isInterface()) return JavaHighlightInfoTypes.INTERFACE_NAME; if (aClass.isEnum()) return JavaHighlightInfoTypes.ENUM_NAME; if (aClass instanceof PsiTypeParameter) return JavaHighlightInfoTypes.TYPE_PARAMETER_NAME; PsiModifierList modList = aClass.getModifierList(); if (modList != null && modList.hasModifierProperty(PsiModifier.ABSTRACT)) return JavaHighlightInfoTypes.ABSTRACT_CLASS_NAME; } // use class by default return JavaHighlightInfoTypes.CLASS_NAME; }