Package com.intellij.openapi.roots.libraries

Examples of com.intellij.openapi.roots.libraries.LibraryTable


    });
    return libraries.toArray(new Library[libraries.size()]);
  }

  public static Library[] getLibraries(Condition<Library> condition) {
    LibraryTable table = LibraryTablesRegistrar.getInstance().getLibraryTable();
    List<Library> libs = ContainerUtil.findAll(table.getLibraries(), condition);
    return libs.toArray(new Library[libs.size()]);
  }
View Full Code Here


      moduleModel.commit();
    }
  }

  public static Library[] getGlobalLibraries(Condition<Library> condition) {
    LibraryTable table = LibraryTablesRegistrar.getInstance().getLibraryTable();
    List<Library> libs = ContainerUtil.findAll(table.getLibraries(), condition);
    return libs.toArray(new Library[libs.size()]);
  }
View Full Code Here

  }

  @Nullable
  public static Library getLibraryByName(String name) {
    if (name == null) return null;
    LibraryTable table = LibraryTablesRegistrar.getInstance().getLibraryTable();
    return table.getLibraryByName(name);
  }
View Full Code Here

    libs.forEachLibrary(processor);
    if (processor.result) {
      if (rootModel == null) {
        rootModel = rootManager.getModifiableModel();
      }
      final LibraryTable libraryTable = rootModel.getModuleLibraryTable();
      final Library scalaLib = libraryTable.createLibrary(clojureLibraryName);
      final Library.ModifiableModel libModel = scalaLib.getModifiableModel();
      libModels.add(libModel);
      addLibraryRoots(libModel, mockLib, mockLibSrc);
    }
    return rootModel;
View Full Code Here

    }
    else {
      rootModel.inheritCompilerOutputPath(true);
    }

    LibraryTable libraryTable = rootModel.getModuleLibraryTable();
    for (Pair<String, String> libInfo : myModuleLibraries) {
      final String moduleLibraryPath = libInfo.first;
      final String sourceLibraryPath = libInfo.second;
      Library library = libraryTable.createLibrary();
      Library.ModifiableModel modifiableModel = library.getModifiableModel();
      modifiableModel.addRoot(getUrlByPath(moduleLibraryPath), OrderRootType.CLASSES);
      if (sourceLibraryPath != null) {
        modifiableModel.addRoot(getUrlByPath(sourceLibraryPath), OrderRootType.SOURCES);
      }
View Full Code Here

            }
            JarFileWriter jarFileWriter = new JarFileWriter();
            jarFileWriter.writeJarFile(lib, name + ".jar", new File(temp.getAbsolutePath() + File.separator + "classes"));
            Project project = codegenBean.getActiveProject();

            final LibraryTable table = (LibraryTable) project.getComponent(LibraryTable.class);

            ApplicationManager.getApplication().runWriteAction(new
                    Runnable() {
                        public void run() {
                            String url = VirtualFileManager.constructUrl(JarFileSystem.PROTOCOL, lib.getAbsolutePath() + File.separator + name + ".jar") + JarFileSystem.JAR_SEPARATOR;

                            VirtualFile jarVirtualFile = VirtualFileManager.getInstance().findFileByUrl(url);
                            Library myLibrary = table.createLibrary(name);
                            Library.ModifiableModel libraryModel = myLibrary.getModifiableModel();
                            libraryModel.addRoot(jarVirtualFile, OrderRootType.CLASSES);
                            libraryModel.commit();

                        }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.roots.libraries.LibraryTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.