@NotNull
 @Override
 protected Library[] getLibraries(@NotNull LibraryTable table) {
   if (table.getTableLevel().equals(LibraryTableImplUtil.MODULE_LEVEL)) {
     return myCreatedModuleLibraries.toArray(new Library[myCreatedModuleLibraries.size()]);
   }
   final LibrariesModifiableModel model = getLibrariesModifiableModel(table);
   if (model == null) return Library.EMPTY_ARRAY;
   return model.getLibraries();
 }
 @NotNull
 private String getLibraryName(@NotNull Library library) {
   final LibrariesModifiableModel model = getLibrariesModifiableModel(library.getTable());
   if (model != null) {
     if (model.hasLibraryEditor(library)) {
       return model.getLibraryEditor(library).getName();
     }
   }
   return library.getName();
 }
コード例 #3
0
 private boolean hasLibraries() {
   final Predicate<Library> condition =
       LibraryEditingUtil.getNotAddedLibrariesCondition(myClasspathPanel.getRootModel());
   for (LibraryTable table :
       ChooseLibrariesFromTablesDialog.getLibraryTables(myClasspathPanel.getProject(), true)) {
     final LibrariesModifiableModel model = myContext.myLevel2Providers.get(table.getTableLevel());
     if (model != null) {
       for (Library library : model.getLibraries()) {
         if (condition.apply(library)) {
           return true;
         }
       }
     }
   }
   return false;
 }