From: Marko Luukkainen Date: Mon, 3 Apr 2017 14:02:00 +0000 (+0300) Subject: Add third Resource reference to UpdateEditorInput for three-way X-Git-Tag: v1.31.0~22 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=930c049303df44922114e177e174a3c94d423b7f;p=simantics%2Finterop.git Add third Resource reference to UpdateEditorInput for three-way comparison support. refs #7045 Change-Id: I3137324f7ce6c2d9981d2a148167c0e1e8cfaebf --- diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/editor/UpdateEditorInput.java b/org.simantics.interop.update/src/org/simantics/interop/update/editor/UpdateEditorInput.java index 3c0a025..83b381f 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/editor/UpdateEditorInput.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/editor/UpdateEditorInput.java @@ -17,8 +17,13 @@ public class UpdateEditorInput extends ResourceEditorInput2{ private String editorID; private Resource r1; private Resource r2; + private Resource r3; 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, Resource r3, Resource model, RVI rvi) { super(editorID, r1, model, rvi); this.r1 = r1; this.r2 = r2; @@ -33,6 +38,10 @@ public class UpdateEditorInput extends ResourceEditorInput2{ return r2; } + public Resource getR3() { + return r3; + } + public void openEditor() throws PartInitException { WorkbenchUtils.openEditor(editorID, this); diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateList.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateList.java index 447ddff..747cd78 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateList.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateList.java @@ -50,6 +50,10 @@ public class UpdateList { selected.remove(change); } + public boolean isSelected(Pair change) { + return selected.contains(change); + } + public void clear() { changes.clear(); selected.clear();