Library () { final LibraryTable.ModifiableModel modifiableModel = getTableModifiableModel(); final LibraryType<?> type = myLibraryEditor.getType(); final Library library = modifiableModel.createLibrary(myLibraryEditor.getName(), type != null ? type.getKind() : null); final LibraryEx.ModifiableModelEx model = (LibraryEx.ModifiableModelEx)library.getModifiableModel(); myLibraryEditor.applyTo(model); WriteAction.run(() -> model.commit()); return library; }