1 package org.simantics.sysdyn.ui.properties.widgets.arrays;
\r
3 import java.util.HashMap;
\r
4 import java.util.Map;
\r
6 import org.simantics.browsing.ui.graph.impl.contributor.labeler.ColumnLabelerContributorImpl;
\r
7 import org.simantics.db.ReadGraph;
\r
8 import org.simantics.db.Resource;
\r
9 import org.simantics.db.common.utils.NameUtils;
\r
10 import org.simantics.db.exception.DatabaseException;
\r
11 import org.simantics.sysdyn.ui.properties.widgets.ColumnKeys;
\r
13 public class ConflictingEnumerationLabeler extends ColumnLabelerContributorImpl<ConflictingEnumerationNode>{
\r
16 public Map<String, String> getLabel(ReadGraph graph, ConflictingEnumerationNode input)
\r
17 throws DatabaseException {
\r
18 HashMap<String, String> map = new HashMap<String, String>();
\r
20 boolean first = true;
\r
21 StringBuilder names = new StringBuilder();
\r
22 for(Resource r : (Resource[])input.data) {
\r
27 String name = "empty";
\r
29 name = NameUtils.getSafeName(graph, r);
\r
32 map.put(ColumnKeys.ENUMERATION, names.toString());
\r
34 map.put(ColumnKeys.INDEXES, "Conflicting enumerations");
\r