]> gerrit.simantics Code Review - simantics/sysdyn.git/blob
78333c56d8ccc1cd721f251ac22c78b61700934c
[simantics/sysdyn.git] /
1 package org.simantics.sysdyn.ui.browser.contributions;\r
2 \r
3 import org.simantics.browsing.ui.content.LabelDecorator;\r
4 import org.simantics.browsing.ui.graph.contributor.labeler.LabelDecoratorContributor;\r
5 import org.simantics.db.Builtins;\r
6 import org.simantics.db.ReadGraph;\r
7 import org.simantics.db.exception.DatabaseException;\r
8 import org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode;\r
9 \r
10 public class SimulationResultDecorator extends LabelDecoratorContributor<SimulationResultNode>{\r
11 \r
12     @Override\r
13     public LabelDecorator getDecorator(ReadGraph graph, SimulationResultNode result) throws DatabaseException {\r
14         Builtins b = graph.getBuiltins();\r
15         if (graph.hasStatement(result.resource, b.IsActive)) {\r
16             return new LabelDecorator.Stub() {\r
17                 @Override\r
18                 public String decorateLabel(String label, String column, int itemIndex) {\r
19                     return label + " [ACTIVE]";\r
20                 }\r
21             };\r
22         }\r
23         return null;\r
24     }\r
25 \r
26 }\r