]> gerrit.simantics Code Review - simantics/sysdyn.git/blob
3ec071fcc5cb1b7bbcc9927af56b63645d311061
[simantics/sysdyn.git] /
1 package org.simantics.sysdyn.ui.browser.contributions;\r
2 \r
3 import org.simantics.browsing.ui.graph.contributor.labeler.LabelerContributor;\r
4 import org.simantics.db.ReadGraph;\r
5 import org.simantics.db.exception.DatabaseException;\r
6 import org.simantics.layer0.Layer0;\r
7 import org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode;\r
8 \r
9 public class SimulationResultLabeler extends LabelerContributor<SimulationResultNode>{\r
10 \r
11     @Override\r
12     public String getLabel(ReadGraph graph, SimulationResultNode result) throws DatabaseException {\r
13         String name = graph.getPossibleRelatedValue(result.data, Layer0.getInstance(graph).HasLabel);\r
14         return name == null ? "Experiment (no name)" : name;\r
15     }\r
16 \r
17 }\r