-package org.simantics.modeling.query;\r
-\r
-import java.util.Collection;\r
-\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.variable.ProxyChildVariable;\r
-import org.simantics.db.layer0.variable.Variable;\r
-\r
-public class QueryProxyChildVariable extends ProxyChildVariable {\r
-\r
- public QueryProxyChildVariable(Variable base, Variable parent, Variable other, String name) {\r
- super(base, parent, other, name);\r
- }\r
-\r
- @Override\r
- public Variable create(Variable base, Variable parent, Variable other, String name) {\r
- return new QueryProxyChildVariable(base, parent, other, name);\r
- }\r
- \r
- public Variable getPossibleChild(ReadGraph graph, String name) throws DatabaseException {\r
- \r
- if(CONTEXT_END.equals(name)) {\r
- if(other instanceof ProxyChildVariable) {\r
- // The context is also a proxy - let it do the job\r
- return super.getPossibleChild(graph, name);\r
- } else {\r
- return new QueryRootVariable(this, base.getRepresents(graph));\r
- }\r
- }\r
- \r
- return super.getPossibleChild(graph, name);\r
- \r
- }\r
- \r
- public Collection<Variable> getChildren(ReadGraph graph) throws DatabaseException {\r
-\r
- Collection<Variable> result = super.getChildren(graph);\r
- if(!(base instanceof ProxyChildVariable)) {\r
- result.add(new QueryRootVariable(this, base.getRepresents(graph)));\r
- }\r
- return result;\r
- \r
- } \r
- \r
+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<Variable> getChildren(ReadGraph graph) throws DatabaseException {
+
+ Collection<Variable> result = super.getChildren(graph);
+ if(!(base instanceof ProxyChildVariable)) {
+ result.add(new QueryRootVariable(this, base.getRepresents(graph)));
+ }
+ return result;
+
+ }
+