final Combo combo= new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
combo.setLayoutData(gd);
combo.setToolTipText(preference.getDescription());
for (Iterator it= domain.fItems.iterator(); it.hasNext();) {
EnumValue value= (EnumValue) it.next();
combo.add(value.getLabel());
}
combo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
int index= combo.getSelectionIndex();
EnumValue value= domain.getValueByIndex(index);
IStatus status= domain.validate(value);
if (!status.matches(IStatus.ERROR))
fOverlayStore.setValue(preference.getKey(), value.getIntValue());
updateStatus(status);
}
});
fInitializers.add(fInitializerFactory.create(preference, combo, domain));