}
protected Control createSWTControl(FormControl control,
BasicRenderer parent, LayoutContext c, CalculatedStyle style,
UserAgentCallback uac) {
final CheckControl cc = (CheckControl) control;
final Button button = new Button(parent, (cc.isRadio() ? SWT.RADIO
: SWT.CHECK));
button.setText("");
button.setSelection(cc.isSuccessful());
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (!button.getSelection() && cc.isRadio()) {
button.setSelection(true);
} else {
cc.setSuccessful(button.getSelection());
}
}
});
cc.addFormControlListener(new FormControlAdapter() {
public void successful(FormControl control) {
button.setSelection(control.isSuccessful());
}
});