X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.structural2%2Fsrc%2Forg%2Fsimantics%2Fstructural2%2Futils%2FStructuralUtils.java;h=c5b0087e237def41d9a962f5dac5702bbc501cdf;hp=584b4acf73f924f4ab57de7de12764fc39548ec3;hb=4b2ffb1be3b95a8d7b87fc9267e2b3921643a9b3;hpb=8d9659a857fb83a9fdb5c9c8663302765fddd3e8 diff --git a/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java b/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java index 584b4acf7..c5b0087e2 100644 --- a/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java +++ b/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java @@ -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); + } }