]> gerrit.simantics Code Review - simantics/interop.git/blobdiff - org.simantics.interop.update/src/org/simantics/interop/update/editor/UpdateEditorInput.java
Three-way comparison: utilise old changes in the update step
[simantics/interop.git] / org.simantics.interop.update / src / org / simantics / interop / update / editor / UpdateEditorInput.java
index f54b1c935e9439e471ea175382b41486b62e558b..0494b0b5666f453f0c60fca41abb307ad5193e6a 100644 (file)
@@ -18,13 +18,23 @@ public class UpdateEditorInput extends ResourceEditorInput2{
        private Resource r1;
        private Resource r2;
        private Resource r3;
+       private boolean newDistinct = false;
        
-       public UpdateEditorInput(String editorID, Resource r1, Resource r2, Resource model, RVI rvi) {
-               this(editorID, r1, r2, null, model, rvi);
+       
+       public UpdateEditorInput(String editorID, Resource r1, Resource r2, RVI rvi) {
+               this(editorID, r1, r2, null,rvi);
        }
        
-       public UpdateEditorInput(String editorID, Resource r1, Resource r2, Resource r3, Resource model, RVI rvi) {
-               super(editorID, r1, model, rvi);
+       /**
+        * 
+        * @param editorID
+        * @param r1  old model that is being updated
+        * @param r2  new model containing the changes that we want to apply
+        * @param r3  original model to detect user mace changes to the old model r1. This parameter can be 
+        * @param rvi
+        */
+       public UpdateEditorInput(String editorID, Resource r1, Resource r2, Resource r3, RVI rvi) {
+               super(editorID, r1, r1, rvi);
                this.r1 = r1;
                this.r2 = r2;
                this.r3 = r3;
@@ -48,4 +58,14 @@ public class UpdateEditorInput extends ResourceEditorInput2{
                WorkbenchUtils.openEditor(editorID, this);
        }
        
+       // With tree-way comparison, treat new resources for compared old and new models as distinct.
+       // default : false. Comparison may consider that new objects in models r1 and r2 are the same. 
+       public boolean isNewDistinct() {
+               return newDistinct;
+       }
+       
+       public void setNewDistinct(boolean newDistinct) {
+               this.newDistinct = newDistinct;
+       }
+       
 }