1 package com
.intellij
.openapi
.roots
.ui
.configuration
.packaging
;
3 import com
.intellij
.openapi
.project
.ProjectBundle
;
4 import com
.intellij
.openapi
.roots
.OrderRootType
;
5 import com
.intellij
.openapi
.roots
.libraries
.Library
;
6 import com
.intellij
.openapi
.vfs
.VirtualFile
;
7 import com
.intellij
.packaging
.impl
.ui
.LibraryElementPresentation
;
8 import org
.jetbrains
.annotations
.NotNull
;
13 public class PackagingEditorUtil
{
14 private PackagingEditorUtil() {
17 public static String
getLibraryItemText(final @NotNull Library library
, final boolean includeTableName
) {
18 String name
= library
.getName();
19 VirtualFile
[] files
= library
.getFiles(OrderRootType
.CLASSES
);
21 return name
+ (includeTableName ? LibraryElementPresentation
.getLibraryTableComment(library
) : "");
23 else if (files
.length
> 0) {
24 return files
[0].getName() + (includeTableName ? LibraryElementPresentation
.getLibraryTableComment(library
) : "");
27 return ProjectBundle
.message("library.empty.item");