&& target instanceof IObservableValue) {
return bindValue((IObservableValue) source,
(IObservableValue) target, dataBinding);
} else if (source instanceof IObservableSet
&& target instanceof IObservableSet) {
IValueConverter converter = null;
int sourceToTargetPolicy = UpdateSetStrategy.POLICY_UPDATE;
int targetToSourcePolicy = UpdateSetStrategy.POLICY_UPDATE;
// Set policy to UpdateValueStrategy.
if (dataBinding != null) {
switch (dataBinding.getMode()) {
case OneWay:
targetToSourcePolicy = UpdateSetStrategy.POLICY_NEVER;
break;
case OneTime:
sourceToTargetPolicy = UpdateSetStrategy.POLICY_NEVER;
targetToSourcePolicy = UpdateSetStrategy.POLICY_NEVER;
break;
default:
break;
}
converter = dataBinding.getConverter();
}
UpdateSetStrategy sourceToTarget = new UpdateSetStrategy(
sourceToTargetPolicy);
UpdateSetStrategy targetToSource = new UpdateSetStrategy(
targetToSourcePolicy);
return bindSet((IObservableSet) target, (IObservableSet) source,
targetToSource, sourceToTarget, converter);
} else if (source instanceof IObservableList
&& target instanceof IObservableList) {
IValueConverter converter = null;
int sourceToTargetPolicy = UpdateListStrategy.POLICY_UPDATE;
int targetToSourcePolicy = UpdateListStrategy.POLICY_UPDATE;
// Set policy to UpdateValueStrategy.
if (dataBinding != null) {
switch (dataBinding.getMode()) {