]> gerrit.simantics Code Review - simantics/interop.git/blobdiff - org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateOp.java
Added support for filtering changes
[simantics/interop.git] / org.simantics.interop.update / src / org / simantics / interop / update / model / UpdateOp.java
index 6809ea75811de08cf0b2d9013a454a8be484e1dc..00d113938bb83c7c3d909b91083a18c0d00f86d3 100644 (file)
@@ -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<UpdateOp> parentOps = new ArrayList<UpdateOp>();
        private Collection<UpdateOp> subOps = new ArrayList<UpdateOp>();
@@ -142,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;
@@ -164,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