Package com.intellij.webcore.libraries

Examples of com.intellij.webcore.libraries.ScriptingLibraryMappings


  @Nullable
  private ErrorMessage createLibraryAndAssociate() {
    String libraryName = myLibraryNameTextField.getText();
    ScriptingLibraryModel libraryModel = myLibraryHelper.getOrCreateJsLibraryModel(libraryName);
    try {
      ScriptingLibraryMappings libraryMappings = ServiceManager.getService(myProject, JSLibraryMappings.class);
      if (myModuleSelector.isProjectAssociationDialog()) {
        if (myModuleSelector.isProjectAssociationRequested()) {
          libraryMappings.associateWithProject(libraryModel.getName());
          LOG.info("Library '" + libraryModel.getName() + "' has been successfully associated with the project");
        }
        else {
          libraryMappings.disassociateWithProject(libraryModel.getName());
        }
      }
      else {
        for (Module module : myModuleSelector.getSelectedModules()) {
          ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module);
          VirtualFile[] roots = moduleRootManager.getContentRoots();
          for (VirtualFile root : roots) {
            libraryMappings.associate(root, libraryModel.getName(), false);
            LOG.info("Library '" + libraryModel.getName() + "' has been associated with " + root);
          }
        }
      }
      myLibraryHelper.commit();
View Full Code Here

TOP

Related Classes of com.intellij.webcore.libraries.ScriptingLibraryMappings

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.