Search in sources :

Example 11 with LibraryTable

use of com.intellij.openapi.roots.libraries.LibraryTable in project intellij-community by JetBrains.

the class LibraryTest method testNativePathSerialization.

public void testNativePathSerialization() {
    LibraryTable table = getLibraryTable();
    Library library = new WriteAction<Library>() {

        @Override
        protected void run(@NotNull Result<Library> result) throws Throwable {
            Library res = table.createLibrary("native");
            result.setResult(res);
        }
    }.execute().throwException().getResultObject();
    Library.ModifiableModel model = library.getModifiableModel();
    model.addRoot("file://native-lib-root", NativeLibraryOrderRootType.getInstance());
    commit(model);
    Element element = serialize(library);
    PlatformTestUtil.assertElementEquals("<root><library name=\"native\"><CLASSES /><JAVADOC />" + "<NATIVE><root url=\"file://native-lib-root\" /></NATIVE>" + "<SOURCES /></library></root>", element);
}
Also used : ProjectLibraryTable(com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable) LibraryTable(com.intellij.openapi.roots.libraries.LibraryTable) Element(org.jdom.Element) Library(com.intellij.openapi.roots.libraries.Library)

Example 12 with LibraryTable

use of com.intellij.openapi.roots.libraries.LibraryTable in project intellij-community by JetBrains.

the class LibraryConfigurable method getBannerSlogan.

@Override
public String getBannerSlogan() {
    final LibraryTable libraryTable = myLibrary.getTable();
    String libraryType = libraryTable == null ? ProjectBundle.message("module.library.display.name", 1) : libraryTable.getPresentation().getDisplayName(false);
    return ProjectBundle.message("project.roots.library.banner.text", getDisplayName(), libraryType);
}
Also used : LibraryTable(com.intellij.openapi.roots.libraries.LibraryTable)

Example 13 with LibraryTable

use of com.intellij.openapi.roots.libraries.LibraryTable in project intellij-community by JetBrains.

the class StructureConfigurableContext method resetLibraries.

public void resetLibraries() {
    final LibraryTablesRegistrar tablesRegistrar = LibraryTablesRegistrar.getInstance();
    myLevel2Providers.clear();
    myLevel2Providers.put(LibraryTablesRegistrar.APPLICATION_LEVEL, new LibrariesModifiableModel(tablesRegistrar.getLibraryTable(), myProject, this));
    myLevel2Providers.put(LibraryTablesRegistrar.PROJECT_LEVEL, new LibrariesModifiableModel(tablesRegistrar.getLibraryTable(myProject), myProject, this));
    for (final LibraryTable table : tablesRegistrar.getCustomLibraryTables()) {
        myLevel2Providers.put(table.getTableLevel(), new LibrariesModifiableModel(table, myProject, this));
    }
}
Also used : LibraryTable(com.intellij.openapi.roots.libraries.LibraryTable) LibraryTablesRegistrar(com.intellij.openapi.roots.libraries.LibraryTablesRegistrar)

Example 14 with LibraryTable

use of com.intellij.openapi.roots.libraries.LibraryTable in project intellij-community by JetBrains.

the class ChooseLibrariesFromTablesDialog method getLibraryTables.

public static List<LibraryTable> getLibraryTables(final Project project, final boolean showCustomLibraryTables) {
    final List<LibraryTable> tables = new ArrayList<>();
    final LibraryTablesRegistrar registrar = LibraryTablesRegistrar.getInstance();
    if (project != null) {
        tables.add(registrar.getLibraryTable(project));
    }
    tables.add(registrar.getLibraryTable());
    if (showCustomLibraryTables) {
        for (LibraryTable table : registrar.getCustomLibraryTables()) {
            tables.add(table);
        }
    }
    return tables;
}
Also used : LibraryTable(com.intellij.openapi.roots.libraries.LibraryTable) ArrayList(java.util.ArrayList) LibraryTablesRegistrar(com.intellij.openapi.roots.libraries.LibraryTablesRegistrar)

Example 15 with LibraryTable

use of com.intellij.openapi.roots.libraries.LibraryTable in project intellij-community by JetBrains.

the class RootsChangedTest method testGlobalLibraryChangeEvent.

public void testGlobalLibraryChangeEvent() throws Exception {
    final LibraryTable globalLibraryTable = LibraryTablesRegistrar.getInstance().getLibraryTable();
    verifyLibraryTableEditing(globalLibraryTable);
}
Also used : LibraryTable(com.intellij.openapi.roots.libraries.LibraryTable)

Aggregations

LibraryTable (com.intellij.openapi.roots.libraries.LibraryTable)64 Library (com.intellij.openapi.roots.libraries.Library)43 ProjectLibraryTable (com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable)18 VirtualFile (com.intellij.openapi.vfs.VirtualFile)16 Module (com.intellij.openapi.module.Module)10 NotNull (org.jetbrains.annotations.NotNull)7 Project (com.intellij.openapi.project.Project)5 LibraryEx (com.intellij.openapi.roots.impl.libraries.LibraryEx)5 LibraryTablesRegistrar (com.intellij.openapi.roots.libraries.LibraryTablesRegistrar)4 File (java.io.File)4 Element (org.jdom.Element)4 LibraryImpl (com.intellij.openapi.roots.impl.libraries.LibraryImpl)3 ArrayList (java.util.ArrayList)3 FlexLibraryProperties (com.intellij.lang.javascript.flex.library.FlexLibraryProperties)2 Application (com.intellij.openapi.application.Application)2 Result (com.intellij.openapi.application.Result)2 Sdk (com.intellij.openapi.projectRoots.Sdk)2 ModifiableRootModel (com.intellij.openapi.roots.ModifiableRootModel)2 OrderEntry (com.intellij.openapi.roots.OrderEntry)2 ModuleLibraryTable (com.intellij.openapi.roots.impl.ModuleLibraryTable)2