X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fquery%2FQueryProxyChildVariable.java;h=8202837df671361028e858b1435dd0ac3e82f1ef;hb=06ee0c4c71cd9e372969da1570e7fcac2c4397a5;hp=6c62c4eb513eee5f88a065e79b8dfb8fedb43abc;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/query/QueryProxyChildVariable.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/query/QueryProxyChildVariable.java index 6c62c4eb5..8202837df 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/query/QueryProxyChildVariable.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/query/QueryProxyChildVariable.java @@ -1,46 +1,46 @@ -package org.simantics.modeling.query; - -import java.util.Collection; - -import org.simantics.db.ReadGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.layer0.variable.ProxyChildVariable; -import org.simantics.db.layer0.variable.Variable; - -public class QueryProxyChildVariable extends ProxyChildVariable { - - public QueryProxyChildVariable(Variable base, Variable parent, Variable other, String name) { - super(base, parent, other, name); - } - - @Override - public Variable create(Variable base, Variable parent, Variable other, String name) { - return new QueryProxyChildVariable(base, parent, other, name); - } - - public Variable getPossibleChild(ReadGraph graph, String name) throws DatabaseException { - - if(CONTEXT_END.equals(name)) { - if(other instanceof ProxyChildVariable) { - // The context is also a proxy - let it do the job - return super.getPossibleChild(graph, name); - } else { - return new QueryRootVariable(this, base.getRepresents(graph)); - } - } - - return super.getPossibleChild(graph, name); - - } - - public Collection getChildren(ReadGraph graph) throws DatabaseException { - - Collection result = super.getChildren(graph); - if(!(base instanceof ProxyChildVariable)) { - result.add(new QueryRootVariable(this, base.getRepresents(graph))); - } - return result; - - } - +package org.simantics.modeling.query; + +import java.util.Collection; + +import org.simantics.db.ReadGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.ProxyChildVariable; +import org.simantics.db.layer0.variable.Variable; + +public class QueryProxyChildVariable extends ProxyChildVariable { + + public QueryProxyChildVariable(Variable base, Variable parent, Variable other, String name) { + super(base, parent, other, name); + } + + @Override + public Variable create(Variable base, Variable parent, Variable other, String name) { + return new QueryProxyChildVariable(base, parent, other, name); + } + + public Variable getPossibleChild(ReadGraph graph, String name) throws DatabaseException { + + if(CONTEXT_END.equals(name)) { + if(other instanceof ProxyChildVariable) { + // The context is also a proxy - let it do the job + return super.getPossibleChild(graph, name); + } else { + return new QueryRootVariable(this, base.getRepresents(graph)); + } + } + + return super.getPossibleChild(graph, name); + + } + + public Collection getChildren(ReadGraph graph) throws DatabaseException { + + Collection result = super.getChildren(graph); + if(!(base instanceof ProxyChildVariable)) { + result.add(new QueryRootVariable(this, base.getRepresents(graph))); + } + return result; + + } + } \ No newline at end of file