X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FPropertyChange.java;fp=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FPropertyChange.java;h=54d2f76f55fe083f1af1f54a904cf0cc79709dd6;hb=1895b93f561dd38f0dcaa8e4a59210508613a2ea;hp=947f516849ea7c6beea0f4ad5b982eb85d15985b;hpb=a3205f2678c565cfe995c5faadb42ee7095dc8cd;p=simantics%2Finterop.git diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java index 947f516..54d2f76 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java @@ -16,6 +16,8 @@ public class PropertyChange { protected boolean selected = false; protected boolean visible = true; protected boolean enabled = true; + protected Object customValue = null; + public PropertyChange(GraphChanges changes, Resource left, Statement first, Resource right, Statement second) { if (first == null && second == null) @@ -89,18 +91,20 @@ public class PropertyChange { return; } Resource s = leftSubject; - //Resource s = changes.getComparable().getLeft(rightSubject); - //Resource s = pair.first.getSubject(); + Object value = null; + if (customValue != null) + value = customValue; + else if (graph.hasValue(pair.second.getObject())) { + value = graph.getValue(pair.second.getObject()); + } Resource pred = pair.second.getPredicate(); - if (graph.hasValue(pair.second.getObject())) { - Object value = graph.getValue(pair.second.getObject()); + if (value != null) { graph.deny(s, pred); graph.claimLiteral(s, pred, value); } else { graph.deny(s,pred); } applied = true; - } /** @@ -175,4 +179,12 @@ public class PropertyChange { return s; } + public Object getCustomValue() { + return customValue; + } + + public void setCustomValue(Object customValue) { + this.customValue = customValue; + } + }