X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2FImmutableComponentVariable.java;h=5deac4e9413fcfbee3f24d69625e326af851a8e0;hb=68ce0966a57f5153b133c6283fdbae10f683b745;hp=6ed9273906e090dc805e52d7583f5d139cd99988;hpb=ded784594eb0e1fb318fbb931135288152691cf2;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/ImmutableComponentVariable.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/ImmutableComponentVariable.java index 6ed927390..5deac4e94 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/ImmutableComponentVariable.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/ImmutableComponentVariable.java @@ -12,6 +12,7 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.variable.AbstractChildVariable; import org.simantics.db.layer0.variable.StandardGraphChildVariable; import org.simantics.db.layer0.variable.Variable; +import org.simantics.structural.stubs.StructuralResource2; public class ImmutableComponentVariable extends AbstractChildVariable { @@ -71,6 +72,11 @@ public class ImmutableComponentVariable extends AbstractChildVariable { @Override public Variable getPossibleChild(ReadGraph graph, String name) throws DatabaseException { + + if(content.procedural) { + return new StandardGraphChildVariable(parent, null, content.resource).getPossibleChild(graph, name); + } + if(content.children == null) return null; ImmutableComponentVariableContent c = content.children.get(name); if(c == null) return null; @@ -79,12 +85,18 @@ public class ImmutableComponentVariable extends AbstractChildVariable { @Override public Collection getChildren(ReadGraph graph) throws DatabaseException { + + if(content.procedural) { + return new StandardGraphChildVariable(parent, null, content.resource).getChildren(graph); + } + if(content.children == null) return Collections.emptyList(); ArrayList result = new ArrayList(content.children.size()); for(ImmutableComponentVariableContent c : content.children.values()) { result.add(new ImmutableComponentVariable(this, c)); } return result; + } @Override