]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ProxyVariables.java
For PSaaS
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / variable / ProxyVariables.java
index db552650b09c7098074bfd069b954a9b5d80ca15..d288802e040a562ee4618a42e2d60a71ec0e9a13 100644 (file)
@@ -5,6 +5,22 @@ import org.simantics.db.exception.DatabaseException;
 
 public class ProxyVariables {
        
+    public static Variable tryToOwn(ReadGraph graph, Variable parent, Variable variable) {
+        if(variable instanceof ProxyVariableSupport) {
+            ProxyVariableSupport pvs = (ProxyVariableSupport)variable;
+            return pvs.attachTo(graph, parent);
+        }
+        return null;
+    }
+
+    public static Variable tryToOwnRenamed(ReadGraph graph, Variable parent, Variable variable, String name) {
+        if(variable instanceof ProxyVariableSupport) {
+            ProxyVariableSupport pvs = (ProxyVariableSupport)variable;
+            return pvs.attachToRenamed(graph, parent, name);
+        }
+        return null;
+    }
+
        public static Variable inputVariable(ReadGraph graph, Variable context) throws DatabaseException {
        Variable session = graph.syncRequest(new ProxySessionRequest(context));
        if(session == null) return null;