private Button addCheckBox(Composite composite, final Preference preference, final Domain domain, int indentation) {
final Button checkBox= new Button(composite, SWT.CHECK);
checkBox.setText(preference.getName());
checkBox.setToolTipText(preference.getDescription());
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
gd.horizontalIndent= indentation;
gd.horizontalSpan= 2;
checkBox.setLayoutData(gd);
checkBox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
boolean value= checkBox.getSelection();
IStatus status= domain.validate(Boolean.valueOf(value));
if (!status.matches(IStatus.ERROR))
fOverlayStore.setValue(preference.getKey(), value);
updateStatus(status);
}
});
fInitializers.add(fInitializerFactory.create(preference, checkBox));
return checkBox;
}