ItemPresentation (@NotNull final PsiClass psiClass) { return new ColoredItemPresentation() { @Override public String getPresentableText() { return ClassPresentationUtil.getNameForClass(psiClass, false); } @Override public String getLocationString() { PsiFile file = psiClass.getContainingFile(); if (file instanceof PsiClassOwner) { PsiClassOwner classOwner = (PsiClassOwner)file; String packageName = classOwner.getPackageName(); if (packageName.isEmpty()) return null; return NewUiValue.isEnabled() ? JavaPsiBundle.message("aux.context.display", packageName) : "(" + packageName + ")"; } return null; } @Override public TextAttributesKey getTextAttributesKey() { try { if (psiClass.isDeprecated()) { return CodeInsightColors.DEPRECATED_ATTRIBUTES; } } catch (IndexNotReadyException ignore) { } return null; } @Override public Icon getIcon(boolean open) { return psiClass.getIcon(Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS); } }; }