]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/ImmutableComponentVariable.java
Still working for multiple readers
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / ImmutableComponentVariable.java
index 6ed9273906e090dc805e52d7583f5d139cd99988..5deac4e9413fcfbee3f24d69625e326af851a8e0 100644 (file)
@@ -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<Variable> 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<Variable> result = new ArrayList<Variable>(content.children.size());
                for(ImmutableComponentVariableContent c : content.children.values()) {
                        result.add(new ImmutableComponentVariable(this, c));
                }
                return result;
+               
        }
        
        @Override