1 package org.simantics.sysdyn.ui.browser.contributions;
\r
3 import org.eclipse.jface.resource.FontDescriptor;
\r
4 import org.eclipse.swt.SWT;
\r
5 import org.simantics.browsing.ui.content.LabelDecorator;
\r
6 import org.simantics.browsing.ui.graph.contributor.labeler.LabelDecoratorContributor;
\r
7 import org.simantics.db.ReadGraph;
\r
8 import org.simantics.db.exception.DatabaseException;
\r
9 import org.simantics.simulation.ontology.SimulationResource;
\r
10 import org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode;
\r
12 public class SimulationResultDecorator extends LabelDecoratorContributor<SimulationResultNode>{
\r
15 public LabelDecorator getDecorator(ReadGraph graph, SimulationResultNode result) throws DatabaseException {
\r
16 if (graph.hasStatement(result.data, SimulationResource.getInstance(graph).IsActive)) {
\r
17 return new LabelDecorator.Stub() {
\r
19 @SuppressWarnings("unchecked")
\r
21 public <F> F decorateFont(F font, String column, int itemIndex) {
\r
22 return (F) ((FontDescriptor) font).withStyle(SWT.BOLD);
\r