CellAppearanceEx (Project project, @NotNull final OrderEntry orderEntry, final boolean selected) { if (orderEntry instanceof JdkOrderEntry jdkLibraryEntry) { Sdk jdk = jdkLibraryEntry.getJdk(); if (!orderEntry.isValid()) { final String oldJdkName = jdkLibraryEntry.getJdkName(); return FileAppearanceService.getInstance().forInvalidUrl(oldJdkName != null ? oldJdkName : JavaUiBundle.message("jdk.missing.item")); } return forJdk(jdk, false, selected, true); } else if (!orderEntry.isValid()) { return FileAppearanceService.getInstance().forInvalidUrl(orderEntry.getPresentableName()); } else if (orderEntry instanceof LibraryOrderEntry libraryOrderEntry) { if (!libraryOrderEntry.isValid()) { //library can be removed return FileAppearanceService.getInstance().forInvalidUrl(orderEntry.getPresentableName()); } Library library = libraryOrderEntry.getLibrary(); assert library != null : libraryOrderEntry; return forLibrary(project, library, !((LibraryEx)library).getInvalidRootUrls(OrderRootType.CLASSES).isEmpty()); } else if (orderEntry.isSynthetic()) { String presentableName = orderEntry.getPresentableName(); Icon icon = orderEntry instanceof ModuleSourceOrderEntry ? sourceFolderIcon(false) : null; return new SimpleTextCellAppearance(presentableName, icon, SimpleTextAttributes.SYNTHETIC_ATTRIBUTES); } else if (orderEntry instanceof ModuleOrderEntry entry) { final Icon icon = ModuleType.get(entry.getModule()).getIcon(); return SimpleTextCellAppearance.regular(orderEntry.getPresentableName(), icon); } else { return CompositeAppearance.single(orderEntry.getPresentableName()); } }