import java.util.Collection;
import java.util.List;
+import org.simantics.db.ReadGraph;
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;
+import org.simantics.layer0.Layer0;
/**
* Base class for update operations (adding and deleting objects)
public void addParentOp(UpdateOp op) {
assert (!op.equals(this));
+ if (parentOps.contains(op))
+ return;
parentOps.add(op);
}
public void addSubOp(UpdateOp op) {
assert (!op.equals(this));
+ if (subOps.contains(op))
+ return;
subOps.add(op);
}
*/
public abstract Resource getCreatedResource();
+ public Resource getParentResource(ReadGraph g) throws DatabaseException {
+ Layer0 l0 = Layer0.getInstance(g);
+ return g.getPossibleObject(getResource(), l0.PartOf);
+ }
+
+
@Override
public String toString() {
String s = this.getClass().getSimpleName();