X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FModelUpdate.java;fp=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FModelUpdate.java;h=6e5175707080e7f5587c7b9ea7d52b5ab4b43261;hb=1b3fe1c5f30f4c373cd55df131d3774fe33150ab;hp=51cd1eb4c0c338655e0f8dbc4777e58786dedd43;hpb=e334209213fe36fd7b4f209fa41a15f1e3b9c751;p=simantics%2Finterop.git diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java index 51cd1eb..6e51757 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java @@ -169,6 +169,30 @@ public abstract class ModelUpdate { init = true; } + public void setInput(Resource oldModel, Resource newModel, GraphChanges changes, IProgressMonitor monitor) throws DatabaseException{ + if (!oldModel.equals(changes.getResource1()) || + !newModel.equals(changes.getResource2())) { + throw new DatabaseException("GraphChanges does not match input models"); + } + this.changes = getSession().syncRequest(createFilterRead(changes, filters)); + Pair chg = createChangeObjects(changes, monitor); + if (chg == null) { + dispose(); + return; + } + updateTree = chg.first; + updateList = chg.second; + if (userFilters.size() != 0) { + refreshUserFilters(); + } + + + if (originalModel != null) { + defaultSelections(); + } + init = true; + } + public void addFilter(ChangeFilter filter) { if (init) throw new IllegalStateException("ModelUpdate has been initialized, adjusting filters is no longer possible.");