1 package org.simantics.selectionview;
5 import org.simantics.browsing.ui.common.ColumnKeys;
6 import org.simantics.browsing.ui.model.labels.LabelRule;
7 import org.simantics.db.ReadGraph;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.utils.datastructures.ArrayMap;
11 public class CategoryNodeLabelRule implements LabelRule {
13 private static final String[] COLS = new String[] { ColumnKeys.DISPLAY_PROPERTY };
16 public boolean isCompatible(Class<?> contentType) {
17 return contentType.equals(CategoryNode.class);
21 public Map<String, String> getLabel(ReadGraph graph, Object content)
22 throws DatabaseException {
24 String[] result = new String[] { ((CategoryNode)content).getName() };
25 return new ArrayMap<String, String>(COLS, result);