From: Antti Villberg Date: Wed, 16 Aug 2017 11:55:49 +0000 (+0300) Subject: Support labels for property children X-Git-Tag: v1.31.0~235^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=b281c4418195e8e9c4d6838ea67cbe9affc7b214;ds=sidebyside Support labels for property children refs #7438 Change-Id: I14e45c9301ce46c72dfbc07c9bf2527181d3ea9c --- diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/function/All.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/function/All.java index 5137dd742..7d9d1dba8 100644 --- a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/function/All.java +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/function/All.java @@ -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);