use of com.intellij.openapi.roots.ui.ModifiableCellAppearanceEx in project intellij-community by JetBrains.
the class StructureNodeRenderer method forNodeDescriptorInTree.
public static CellAppearanceEx forNodeDescriptorInTree(Object node, boolean expanded) {
NodeDescriptor descriptor = getNodeDescriptor(node);
if (descriptor == null)
return FileAppearanceService.getInstance().empty();
String name = descriptor.toString();
Object psiElement = descriptor.getElement();
ModifiableCellAppearanceEx result;
if (psiElement instanceof PsiElement && !((PsiElement) psiElement).isValid()) {
result = CompositeAppearance.single(name);
} else {
PsiClass psiClass = getContainingClass(psiElement);
if (isInheritedMember(node, psiClass) && psiClass != null) {
CompositeAppearance.DequeEnd ending = new CompositeAppearance().getEnding();
ending.addText(name, applyDeprecation(psiElement, SimpleTextAttributes.DARK_TEXT));
ending.addComment(psiClass.getName(), applyDeprecation(psiClass, SimpleTextAttributes.GRAY_ATTRIBUTES));
result = ending.getAppearance();
} else {
SimpleTextAttributes textAttributes = applyDeprecation(psiElement, SimpleTextAttributes.REGULAR_ATTRIBUTES);
result = CompositeAppearance.single(name, textAttributes);
}
}
result.setIcon(descriptor.getIcon());
return result;
}
Aggregations