void (final Library library, final VirtualFile[] files) { ApplicationManager.getApplication().runWriteAction(() -> { Library.ModifiableModel model = library.getModifiableModel(); for (VirtualFile virtualFile : files) { model.addRoot(virtualFile, OrderRootType.SOURCES); } model.commit(); }); }