value = ((IObservableValue) observableSource).getValue();
}
return convertedValue(value);
}
BindingGate bindingContext = getBindingGate();
if (bindingContext != null && observableSource != null) {
Object target = getControl();
if (target instanceof Text
&& getTargetProperty().equalsIgnoreCase("text")) {
if (isSourcePropertyReadOnly()) {
Text text = (Text) target;
text.setEditable(false);
}
} else if (target instanceof Button
&& getTargetProperty().equalsIgnoreCase("selection")) {
if (isSourcePropertyReadOnly()) {
Button button = (Button) target;
button.setEnabled(false);
}
} else if ((target instanceof Combo || target instanceof CCombo)
&& getTargetProperty().equalsIgnoreCase("text")) {
if (isSourcePropertyReadOnly()) {
Control control = (Control) target;
control.setEnabled(false);
}
} else if (target instanceof MenuItem
&& getTargetProperty().equalsIgnoreCase("selection")) {
if (isSourcePropertyReadOnly()) {
MenuItem menuItem = (MenuItem) target;
menuItem.setEnabled(false);
}
}
bindingContext.bind(observableSource, observableWidget, this);
}
if (targetType != null && !targetType.isInstance(observableSource)) {
return observableSource;
}