import org.simantics.db.layer0.request.PropertyInfo;
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> {
Layer0 L0 = Layer0.getInstance(graph);
String name = graph.getRelatedValue(resource, L0.HasName, Bindings.STRING);
ImmutableComponentVariableContent result = new ImmutableComponentVariableContent(resource, name);
+
+ StructuralResource2 STR = StructuralResource2.getInstance(graph);
+ Resource componentType = graph.getPossibleType(resource, STR.Component);
+ if(componentType != null)
+ result.procedural = graph.isInstanceOf(componentType, STR.ProceduralComponentType);
Map<String,PropertyInfo> pis = graph.syncRequest(new UnescapedPropertyMapOfResource(resource));
}
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);