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);
}
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);
}
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));
}
}
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;
}
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);
}
Aggregations