Label label = toolkit.createLabel(parent, labelText);
}
Control widget;
Class refType = isBeanRef(value, propertyName);
IObservable observable;
if (boolean.class.isAssignableFrom(propertyType) || Boolean.class.isAssignableFrom(propertyType)) {
Button checkbox = new Button(parent, SWT.CHECK | SWT.BORDER);
widget = checkbox;
ISWTObservableValue textValue = Forms.observe(checkbox);
observable = textValue;
Forms.bindPojoProperty(bindingContext, mmng, value, propertyName, isMandatory(value, propertyName), labelText, textValue, checkbox);
} else if (refType != null) {
Combo combo = new Combo(parent, SWT.NONE | SWT.BORDER);
String[] beanRefs = getBeanRefs(refType);
combo.setItems(beanRefs);
toolkit.adapt(combo, true, true);
widget = combo;
ISWTObservableValue comboValue = WidgetProperties.selection().observe(combo);
observable = comboValue;
Forms.bindPojoProperty(bindingContext, mmng, value, propertyName, isMandatory(value, propertyName), labelText, comboValue, combo);
} else if (isEndpointUri(value, propertyName)) {
Combo combo = new Combo(parent, SWT.NONE | SWT.BORDER);
combo.setItems(getEndpointUris());
toolkit.adapt(combo, true, true);
widget = combo;
ISWTObservableValue comboValue = WidgetProperties.selection().observe(combo);
observable = comboValue;
Forms.bindPojoProperty(bindingContext, mmng, value, propertyName, isMandatory(value, propertyName), labelText, comboValue, combo);
} else if (Enum.class.isAssignableFrom(propertyType)) {
ComboViewer combo = new ComboViewer(parent, SWT.READ_ONLY | SWT.BORDER);
combo.setContentProvider(ArrayContentProvider.getInstance());
combo.setInput(getEnumValues((Class<? extends Enum>) propertyType));
IViewerObservableValue comboValue = ViewersObservables.observeSingleSelection(combo);
observable = comboValue;
Control control = combo.getControl();
Forms.bindPojoProperty(bindingContext, mmng, value, propertyName, isMandatory(value, propertyName), labelText, comboValue, control);
toolkit.adapt(control, true, true);
widget = control;
} else {
Text text = toolkit.createText(parent, "");
widget = text;
// text.setToolTipText(tooltip);
ISWTObservableValue textValue = Forms.observe(text);
observable = textValue;
Forms.bindPojoProperty(bindingContext, mmng, value, propertyName, isMandatory(value, propertyName), labelText, textValue, text);
}
widget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
if (observable != null && node != null) {
observable.addChangeListener(new IChangeListener() {
@Override
public void handleChange(ChangeEvent event) {
// lets notify the node that its changed
String id = complexProperty.getId().toString();