]> gerrit.simantics Code Review - simantics/sysdyn.git/blob
232db37b6bd4afff96a55a60d14b9ac8aff9639a
[simantics/sysdyn.git] /
1 package org.simantics.sysdyn.ui.properties.widgets.arrays;\r
2 \r
3 import org.simantics.browsing.ui.CheckedState;\r
4 import org.simantics.browsing.ui.graph.contributor.labeler.CheckedStateContributor;\r
5 import org.simantics.databoard.Bindings;\r
6 import org.simantics.db.ReadGraph;\r
7 import org.simantics.db.exception.DatabaseException;\r
8 import org.simantics.sysdyn.SysdynResource;\r
9 \r
10 public class ShowInChartsCheckBox extends CheckedStateContributor<EnumerationIndexNode> {\r
11 \r
12         @Override\r
13         public CheckedState getState(ReadGraph graph, EnumerationIndexNode input)\r
14                         throws DatabaseException {\r
15                 SysdynResource sr = SysdynResource.getInstance(graph);\r
16                 Boolean selected = graph.getPossibleRelatedValue(input.data, sr.ShowEnumerationIndexInCharts, Bindings.BOOLEAN);\r
17                 return selected ? CheckedState.CHECKED : CheckedState.NOT_CHECKED;\r
18         }\r
19         \r
20 }\r
21 \r