GridLayout gridLayout = new GridLayout(3, false);
gridLayout.verticalSpacing = 5;
optionGroup.setLayout(gridLayout);
final TextField textFieldX = new TextField(optionGroup, SWT.SINGLE);
final Button setXAxisButton = new Button(optionGroup, SWT.NONE);
setXAxisButton.setText("Set X axis name");
setXAxisButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
theComponent.setAxisName(textFieldX.getText(), IChartViewer.X);
}
});
Button clearXButton = new Button(optionGroup, SWT.PUSH);
clearXButton.setText("Clear");
clearXButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
textFieldX.setText("");
theComponent.setAxisName(null, IChartViewer.X);
}
});
final TextField textFieldY = new TextField(optionGroup, SWT.SINGLE);
textFieldY.getText();
final Button setYAxisButton = new Button(optionGroup, SWT.NONE);
setYAxisButton.setText("Set Y axis name");
setYAxisButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
theComponent.setAxisName(textFieldY.getText(), IChartViewer.Y1);
}
});
Button clearYButton = new Button(optionGroup, SWT.PUSH);
clearYButton.setText("Clear");
clearYButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
textFieldY.setText("");
theComponent.setAxisName(null, IChartViewer.Y1);
}
});
}