]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Merge "Support labels for property children"
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 16 Aug 2017 12:11:47 +0000 (15:11 +0300)
committerGerrit Code Review <gerrit2@www.simantics.org>
Wed, 16 Aug 2017 12:11:47 +0000 (15:11 +0300)
bundles/org.simantics.selectionview/src/org/simantics/selectionview/function/All.java

index 5137dd742ded7dfa2294364aa0e9340cea1fc904..7d9d1dba8b02bfcddc51526ff42a6f0491940949 100644 (file)
@@ -208,6 +208,9 @@ public class All {
        public static Object getPropertyChildName(ReadGraph graph, Resource resource, Object context) throws DatabaseException {
                if(context instanceof Variable) {
                        Variable variable = (Variable)context;
+                       String label = variable.getParent(graph).getPossiblePropertyValue(graph, "HasLabel", Bindings.STRING);
+                       if(label != null)
+                               return label;
                        return variable.getParent(graph).getName(graph);
                }
                throw new DatabaseException("Unknown context " + context);