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.eclipse.swt.graphics.Font;
\r
6 import org.simantics.browsing.ui.content.LabelDecorator;
\r
7 import org.simantics.browsing.ui.graph.contributor.labeler.LabelDecoratorContributor;
\r
8 import org.simantics.db.Builtins;
\r
9 import org.simantics.db.ReadGraph;
\r
10 import org.simantics.db.exception.DatabaseException;
\r
11 import org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode;
\r
13 public class SimulationResultDecorator extends LabelDecoratorContributor<SimulationResultNode>{
\r
16 public LabelDecorator getDecorator(ReadGraph graph, SimulationResultNode result) throws DatabaseException {
\r
17 Builtins b = graph.getBuiltins();
\r
18 if (graph.hasStatement(result.resource, b.IsActive)) {
\r
19 return new LabelDecorator.Stub() {
\r
21 @SuppressWarnings("unchecked")
\r
23 public <F> F decorateFont(F font, String column, int itemIndex) {
\r
24 return (F) FontDescriptor.createFrom((Font) font).withStyle(SWT.BOLD);
\r