X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FUpdateOp.java;h=00d113938bb83c7c3d909b91083a18c0d00f86d3;hb=9a54e6b7fe17613852fc676deb4dc42c3c5e2b8f;hp=72e17856a4a28589a02b09e21795097ea1da93b5;hpb=ca99df4266f28ae07fd4c30edb2831da65b79ffd;p=simantics%2Finterop.git diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateOp.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateOp.java index 72e1785..00d1139 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateOp.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateOp.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Collection; import org.simantics.db.Resource; +import org.simantics.db.Statement; import org.simantics.db.WriteGraph; import org.simantics.db.exception.DatabaseException; import org.simantics.interop.test.GraphChanges; @@ -21,6 +22,7 @@ public abstract class UpdateOp { private boolean selected = false; private boolean manualSelection = false; protected boolean applied = false; + protected boolean visible = true; private Collection parentOps = new ArrayList(); private Collection subOps = new ArrayList(); @@ -104,6 +106,8 @@ public abstract class UpdateOp { private boolean _select(boolean select) { if (select == selected) return true; + if (applied) + return false; if (select) { if (selectParentOps()) { for (UpdateOp op : parentOps) @@ -140,6 +144,12 @@ public abstract class UpdateOp { public boolean applied() { return applied; } + + public boolean isVisible() { + return visible; + } + + public void apply(WriteGraph g) throws DatabaseException { if (applied) return; @@ -162,6 +172,12 @@ public abstract class UpdateOp { */ public abstract Resource getResource(); + /** + * Returns resource that this operation is changing. + * @return + */ + public abstract Statement getStatement(); + /** * Returns resource that this operation created during apply operation. If operation did not add anything, this returns null. * @return