Source:
public SwtXYChartViewer(Composite parent, ChartData data, ChartModel model) { fViewer = this; fParent = parent; fData = data; fModel = model; fXInformation = new DescriptorsInformation(getXDescriptors()); fYInformation = new DescriptorsInformation(getYDescriptors()); validateChartData(); fChart = new Chart(parent, SWT.NONE); fXTitle = generateXTitle(); fYTitle = generateYTitle(); fChart.getTitle().setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); fChart.getAxisSet().getXAxis(0).getTitle().setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); fChart.getAxisSet().getYAxis(0).getTitle().setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); fChart.getAxisSet().getXAxis(0).getTick().setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); fChart.getAxisSet().getYAxis(0).getTick().setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); fChart.getAxisSet().getXAxis(0).getTick().setTickLabelAngle(90); refreshDisplayTitles(); Image close = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_ELCL_REMOVE); fCloseButton = new Button(fChart, SWT.PUSH); fCloseButton.setSize(25, 25); fCloseButton.setLocation(fChart.getSize().x - fCloseButton.getSize().x - 5, 5); fCloseButton.setImage(close); fCloseButton.addSelectionListener(new CloseButtonEvent()); Listener mouseEnter = new MouseEnterEvent(); Listener mouseExit = new MouseExitEvent(); fChart.getDisplay().addFilter(SWT.MouseEnter, mouseEnter); fChart.getDisplay().addFilter(SWT.MouseExit, mouseExit); fChart.addDisposeListener(event -> { fChart.getDisplay().removeFilter(SWT.MouseEnter, mouseEnter); fChart.getDisplay().removeFilter(SWT.MouseExit, mouseExit); }); fChart.addControlListener(new ResizeEvent()); }

Target:
public SwtXYChartViewer(Composite parent, ChartData data, ChartModel model) { fParent = parent; fData = data; fModel = model; fXInformation = new DescriptorsInformation(getXDescriptors()); fYInformation = new DescriptorsInformation(getYDescriptors()); validateChartData(); fChart = new Chart(parent, SWT.NONE); fXTitle = generateXTitle(); fYTitle = generateYTitle(); fChart.getTitle().setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); fChart.getAxisSet().getXAxis(0).getTitle().setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); fChart.getAxisSet().getYAxis(0).getTitle().setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); fChart.getAxisSet().getXAxis(0).getTick().setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); fChart.getAxisSet().getYAxis(0).getTick().setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); fChart.getAxisSet().getXAxis(0).getTick().setTickLabelAngle(90); refreshDisplayTitles(); Image close = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_ELCL_REMOVE); fCloseButton = new Button(fChart, SWT.PUSH); fCloseButton.setSize(25, 25); fCloseButton.setLocation(fChart.getSize().x - fCloseButton.getSize().x - 5, 5); fCloseButton.setImage(close); fCloseButton.addSelectionListener(new CloseButtonEvent()); Listener mouseEnter = new MouseEnterEvent(); Listener mouseExit = new MouseExitEvent(); fChart.getDisplay().addFilter(SWT.MouseEnter, mouseEnter); fChart.getDisplay().addFilter(SWT.MouseExit, mouseExit); fChart.addDisposeListener(event -> { fChart.getDisplay().removeFilter(SWT.MouseEnter, mouseEnter); fChart.getDisplay().removeFilter(SWT.MouseExit, mouseExit); }); fChart.addControlListener(new ResizeEvent()); }