X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fvariable%2FProxyVariables.java;fp=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fvariable%2FProxyVariables.java;h=d288802e040a562ee4618a42e2d60a71ec0e9a13;hb=0db0b69c4abedc90b366631582c57e13f2f110b7;hp=db552650b09c7098074bfd069b954a9b5d80ca15;hpb=512d469c3e490cdfc9a10fbbd6efe92ae6c0358a;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ProxyVariables.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ProxyVariables.java index db552650b..d288802e0 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ProxyVariables.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ProxyVariables.java @@ -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;