]> gerrit.simantics Code Review - simantics/sysdyn.git/blob
de9b255462b849c70a9feeddeac8d166d1c09dee
[simantics/sysdyn.git] /
1 package org.simantics.sysdyn.ui.browser.contributions;\r
2 \r
3 import org.eclipse.jface.resource.ImageDescriptor;\r
4 import org.simantics.browsing.ui.swt.ImagerContributor;\r
5 import org.simantics.db.ReadGraph;\r
6 import org.simantics.db.exception.DatabaseException;\r
7 import org.simantics.simulation.ontology.SimulationResource;\r
8 import org.simantics.sysdyn.ui.Activator;\r
9 import org.simantics.sysdyn.ui.browser.nodes.SimulationResultNode;\r
10 \r
11 public class SimulationResultImager extends ImagerContributor<SimulationResultNode>{\r
12 \r
13     @Override\r
14     public ImageDescriptor getDescriptor(ReadGraph graph, SimulationResultNode result) throws DatabaseException {\r
15         if(graph.hasStatement(result.resource, SimulationResource.getInstance(graph).IsActive))\r
16             return ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getResource("icons/chart_bar.png"));\r
17         else\r
18             return ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getResource("icons/chart_bar_blackAndWhite.png"));\r
19     }\r
20 \r
21 }\r