]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java
Replaceable Defined Component Types fixes
[simantics/platform.git] / bundles / org.simantics.structural2 / src / org / simantics / structural2 / utils / StructuralUtils.java
index 584b4acf73f924f4ab57de7de12764fc39548ec3..c5b0087e237def41d9a962f5dac5702bbc501cdf 100644 (file)
@@ -329,12 +329,16 @@ public class StructuralUtils {
     }
     
     public static Resource getComponentType(ReadGraph graph, Variable configuration, Resource component) throws DatabaseException {
-
         Variable componentVariable = configuration.browse(graph, component);
         return componentVariable.getType(graph);
-
     }
 
+    public static Resource getPossibleComponentType(ReadGraph graph, Variable configuration, Resource component) throws DatabaseException {
+        Variable componentVariable = configuration.browsePossible(graph, component);
+        if(componentVariable == null) return null;
+        StructuralResource2 STR = StructuralResource2.getInstance(graph);
+        return componentVariable.getPossibleType(graph, STR.Component);
+    }
 
 
 }