CellAppearanceEx (Project project, @NotNull final Library library, final boolean hasInvalidRoots) { final StructureConfigurableContext context = ProjectStructureConfigurable.getInstance(project).getContext(); final Icon icon = LibraryPresentationManager.getInstance().getCustomIcon(library, context); final String name = library.getName(); if (name != null) { return normalOrRedWaved(name, (icon != null ? icon : PlatformIcons.LIBRARY_ICON), hasInvalidRoots); } final String[] files = library.getUrls(OrderRootType.CLASSES); if (files.length == 0) { return SimpleTextCellAppearance.invalid(ProjectModelBundle.message("empty.library.title"), PlatformIcons.LIBRARY_ICON); } else if (files.length == 1) { return forVirtualFilePointer(new LightFilePointer(files[0])); } final String url = StringUtil.trimEnd(files[0], JarFileSystem.JAR_SEPARATOR); String text = JavaUiBundle.message("library.unnamed.text", PathUtil.getFileName(url), files.length - 1); return SimpleTextCellAppearance.regular(text, PlatformIcons.LIBRARY_ICON); }