void (@NotNull Element element) { if (myFirstLoad) { myModel.readExternal(element); } else { LibraryModel model = new LibraryModel(myModel); WriteAction.run(() -> { model.readExternal(element); model.commit(); }); } myFirstLoad = false; }