List of usage examples for org.eclipse.swt.widgets Button getData
public Object getData(String key)
From source file:org.talend.dataprofiler.chart.TOPChartService.java
@Override public Object createSelectionAdapterForButton(final Object chart, final boolean isCountAvg, final boolean isMinMax) { return new SelectionAdapter() { private static final String SERIES_KEY_ID = "SERIES_KEY"; //$NON-NLS-1$ @Override//from www .jav a 2 s .c o m public void widgetSelected(SelectionEvent e) { Button checkBtn = (Button) e.getSource(); int seriesid = (Integer) checkBtn.getData(SERIES_KEY_ID); if (isCountAvg) { XYPlot plot = ((JFreeChart) chart).getXYPlot(); XYItemRenderer xyRenderer = plot.getRenderer(); xyRenderer.setSeriesVisible(seriesid, checkBtn.getSelection()); } if (isMinMax) { CategoryPlot plot = (CategoryPlot) ((JFreeChart) chart).getPlot(); CategoryItemRenderer render = plot.getRenderer(); render.setSeriesVisible(seriesid, checkBtn.getSelection()); } } }; }