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