List of usage examples for com.intellij.openapi.roots.ui.util CompositeAppearance single
public static CompositeAppearance single(String text)
From source file:com.intellij.ide.structureView.impl.StructureNodeRenderer.java
License:Apache License
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;// w w w . ja v a 2 s. c o m 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; }