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