--- /dev/null
+package org.simantics.charts.editor;\r
+\r
+import java.util.List;\r
+\r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Status;\r
+import org.eclipse.jface.action.Action;\r
+import org.simantics.charts.Activator;\r
+import org.simantics.charts.query.HideChartItems;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ */\r
+public class HideItemsAction extends Action {\r
+\r
+ private final boolean hide;\r
+ private final List<Resource> chartItems;\r
+\r
+ public HideItemsAction(String name, boolean hide, List<Resource> chartItems) {\r
+ super(name);\r
+ this.hide = hide;\r
+ this.chartItems = chartItems;\r
+ }\r
+\r
+ @Override\r
+ public void run() {\r
+ try {\r
+ HideChartItems.hideChartItems(hide, chartItems);\r
+ } catch (DatabaseException e) {\r
+ Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed to hide chart item.", e));\r
+ }\r
+ }\r
+\r
+}
\ No newline at end of file