List of usage examples for com.intellij.openapi.roots.ui FileAppearanceService getInstance
public static FileAppearanceService getInstance()
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;//from w w w.j a va2s .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; }
From source file:com.intellij.lang.ant.config.impl.AllJarsUnderDirEntry.java
License:Apache License
public CellAppearanceEx getAppearance() { CellAppearanceEx appearance = FileAppearanceService.getInstance().forIoFile(myDir); if (appearance instanceof ModifiableCellAppearanceEx) { ((ModifiableCellAppearanceEx) appearance).setIcon(AllIcons.Nodes.JarDirectory); }// w ww. ja v a2s . c om return appearance; }
From source file:com.intellij.lang.ant.config.impl.SinglePathEntry.java
License:Apache License
public CellAppearanceEx getAppearance() { return FileAppearanceService.getInstance().forIoFile(myFile); }
From source file:org.mustbe.consulo.roots.impl.LibraryOrderEntryTypeProvider.java
License:Apache License
@NotNull @Override//from ww w .ja v a2 s. c o m public CellAppearanceEx getCellAppearance(@NotNull LibraryOrderEntryImpl orderEntry) { if (!orderEntry.isValid()) { //library can be removed return FileAppearanceService.getInstance().forInvalidUrl(orderEntry.getPresentableName()); } Library library = orderEntry.getLibrary(); assert library != null : orderEntry; return OrderEntryAppearanceService.getInstance().forLibrary(orderEntry.getModuleRootLayer().getProject(), library, !((LibraryEx) library).getInvalidRootUrls(BinariesOrderRootType.getInstance()).isEmpty()); }
From source file:org.mustbe.consulo.roots.impl.ModuleLibraryOrderEntryTypeProvider.java
License:Apache License
@NotNull @Override// w w w. j a v a 2s.co m public CellAppearanceEx getCellAppearance(@NotNull ModuleLibraryOrderEntryImpl orderEntry) { if (!orderEntry.isValid()) { //library can be removed return FileAppearanceService.getInstance().forInvalidUrl(orderEntry.getPresentableName()); } Library library = orderEntry.getLibrary(); assert library != null : orderEntry; return OrderEntryAppearanceService.getInstance().forLibrary(orderEntry.getModuleRootLayer().getProject(), library, !((LibraryEx) library).getInvalidRootUrls(BinariesOrderRootType.getInstance()).isEmpty()); }