-package org.simantics.diagram.profile.view;\r
-\r
-import java.util.Collections;\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.common.utils.NameUtils;\r
-import org.simantics.db.exception.DatabaseException;\r
-\r
-public class ResourcePairLabelRule implements LabelRule {\r
- \r
- public static final ResourcePairLabelRule INSTANCE = new ResourcePairLabelRule();\r
- \r
- public ResourcePairLabelRule() {\r
- }\r
-\r
- @Override\r
- public boolean isCompatible(Class<?> contentType) {\r
- return contentType.equals(ResourcePair.class);\r
- }\r
-\r
- @Override\r
- public Map<String,String> getLabel(ReadGraph graph, Object content) throws DatabaseException {\r
- return Collections.singletonMap(ColumnKeys.SINGLE, \r
- NameUtils.getSafeLabel(graph, ((ResourcePair)content).getSecond())\r
- );\r
- }\r
-}\r
+package org.simantics.diagram.profile.view;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.simantics.browsing.ui.common.ColumnKeys;
+import org.simantics.browsing.ui.model.labels.LabelRule;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.common.utils.NameUtils;
+import org.simantics.db.exception.DatabaseException;
+
+public class ResourcePairLabelRule implements LabelRule {
+
+ public static final ResourcePairLabelRule INSTANCE = new ResourcePairLabelRule();
+
+ public ResourcePairLabelRule() {
+ }
+
+ @Override
+ public boolean isCompatible(Class<?> contentType) {
+ return contentType.equals(ProfileTuple.class);
+ }
+
+ @Override
+ public Map<String,String> getLabel(ReadGraph graph, Object content) throws DatabaseException {
+ return Collections.singletonMap(ColumnKeys.SINGLE,
+ NameUtils.getSafeLabel(graph, ((ProfileTuple)content).getEntry())
+ );
+ }
+}