]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/ImmutableComponentVariableContentRequest.java
Work in progress
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / ImmutableComponentVariableContentRequest.java
index cef62c242633e7708131a47a7c92dc0b0148149d..33daefbc4b72bbc660eb76cb6909ba2b569868d9 100644 (file)
@@ -14,7 +14,6 @@ import org.simantics.db.layer0.request.UnescapedPropertyMapOfResource;
 import org.simantics.layer0.Layer0;
 import org.simantics.structural.stubs.StructuralResource2;
 import org.simantics.structural2.ConnectionImpl;
-import org.simantics.structural2.Functions.StructuralChildMapOfResource;
 import org.simantics.structural2.queries.ConnectionPointMapOfResource;
 
 public class ImmutableComponentVariableContentRequest extends ResourceRead<ImmutableComponentVariableContent> {
@@ -59,7 +58,15 @@ public class ImmutableComponentVariableContentRequest extends ResourceRead<Immut
                }
                
                HashSet<Resource> childSet = null;
-               for(Resource child : graph.syncRequest(new StructuralChildMapOfResource(resource)).values()) {
+               
+               Resource container = resource;
+               Resource possibleType = graph.getPossibleType(resource, STR.Component);
+               if(possibleType != null) {
+                       Resource def = graph.getPossibleObject(possibleType, STR.IsDefinedBy);
+                       if(def != null) container = def;
+               }
+               
+               for(Resource child : graph.getChildren(container).values()) {
                        if(childSet == null)
                                childSet = new HashSet<>();
                        childSet.add(child);