]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Support labels for property children 63/863/1
authorAntti Villberg <antti.villberg@semantum.fi>
Wed, 16 Aug 2017 11:55:49 +0000 (14:55 +0300)
committerAntti Villberg <antti.villberg@semantum.fi>
Wed, 16 Aug 2017 11:55:49 +0000 (14:55 +0300)
refs #7438

Change-Id: I14e45c9301ce46c72dfbc07c9bf2527181d3ea9c

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);