Search in sources :

Example 76 with LibraryTable

use of com.intellij.openapi.roots.libraries.LibraryTable in project intellij by bazelbuild.

the class LibraryEditor method updateLibraryDependency.

private static void updateLibraryDependency(ModifiableRootModel model, LibraryKey libraryKey) {
    LibraryTable libraryTable = ProjectLibraryTable.getInstance(model.getProject());
    Library library = libraryTable.getLibraryByName(libraryKey.getIntelliJLibraryName());
    if (library == null) {
        logger.error("Library missing: " + libraryKey.getIntelliJLibraryName() + ". Please resync project to resolve.");
        return;
    }
    model.addLibraryEntry(library);
}
Also used : ProjectLibraryTable(com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable) LibraryTable(com.intellij.openapi.roots.libraries.LibraryTable) BlazeLibrary(com.google.idea.blaze.base.model.BlazeLibrary) Library(com.intellij.openapi.roots.libraries.Library)

Aggregations

LibraryTable (com.intellij.openapi.roots.libraries.LibraryTable)76 Library (com.intellij.openapi.roots.libraries.Library)55 ProjectLibraryTable (com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable)23 VirtualFile (com.intellij.openapi.vfs.VirtualFile)19 Module (com.intellij.openapi.module.Module)11 ModifiableRootModel (com.intellij.openapi.roots.ModifiableRootModel)7 LibraryEx (com.intellij.openapi.roots.impl.libraries.LibraryEx)7 NotNull (org.jetbrains.annotations.NotNull)7 Project (com.intellij.openapi.project.Project)6 File (java.io.File)5 Element (org.jdom.Element)4 BlazeLibrary (com.google.idea.blaze.base.model.BlazeLibrary)3 Result (com.intellij.openapi.application.Result)3 LibraryOrderEntry (com.intellij.openapi.roots.LibraryOrderEntry)3 ModuleRootManager (com.intellij.openapi.roots.ModuleRootManager)3 LibraryTablesRegistrar (com.intellij.openapi.roots.libraries.LibraryTablesRegistrar)3 LocalFileSystem (com.intellij.openapi.vfs.LocalFileSystem)3 FlexLibraryProperties (com.intellij.lang.javascript.flex.library.FlexLibraryProperties)2 Application (com.intellij.openapi.application.Application)2 WriteAction (com.intellij.openapi.application.WriteAction)2