--- /dev/null
+package org.simantics.selectionview;\r
+\r
+import java.util.Map;\r
+\r
+import org.simantics.browsing.ui.common.ColumnKeys;\r
+import org.simantics.browsing.ui.model.labels.LabelRule;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.utils.datastructures.ArrayMap;\r
+\r
+public class CategoryNodeLabelRule implements LabelRule {\r
+\r
+ private static final String[] COLS = new String[] { ColumnKeys.DISPLAY_PROPERTY };\r
+ \r
+ @Override\r
+ public boolean isCompatible(Class<?> contentType) {\r
+ return contentType.equals(CategoryNode.class);\r
+ }\r
+\r
+ @Override\r
+ public Map<String, String> getLabel(ReadGraph graph, Object content)\r
+ throws DatabaseException {\r
+ \r
+ String[] result = new String[] { ((CategoryNode)content).getName() };\r
+ return new ArrayMap<String, String>(COLS, result);\r
+ \r
+ }\r
+\r
+}\r