public IBindingInfo createBinding(IObserveInfo target,
IObserveInfo itargetProperty,
IObserveInfo model,
IObserveInfo imodelProperty) throws Exception {
BeanObserveInfo beanObserve = null;
ObserveInfo modelProperty = null;
WidgetObserveInfo widgetObserve = null;
ObserveInfo targetProperty = null;
//
if (target instanceof WidgetObserveInfo && model instanceof WidgetObserveInfo) {
ObserveInfo gridObserve = null;
//
if (((WidgetObserveInfo) target).isFormPanel()) {
widgetObserve = (WidgetObserveInfo) target;
targetProperty = (ObserveInfo) itargetProperty;
//
gridObserve = (ObserveInfo) model;
modelProperty = (ObserveInfo) imodelProperty;
} else {
widgetObserve = (WidgetObserveInfo) model;
targetProperty = (ObserveInfo) imodelProperty;
//
gridObserve = (ObserveInfo) target;
modelProperty = (ObserveInfo) itargetProperty;
}
//
FormBindingInfo formBinding = new FormBindingInfo(widgetObserve, targetProperty);
formBinding.setModel(gridObserve, modelProperty);
return formBinding;
}
//
if (target instanceof WidgetObserveInfo) {
beanObserve = (BeanObserveInfo) model;
modelProperty = (ObserveInfo) imodelProperty;
//
widgetObserve = (WidgetObserveInfo) target;
targetProperty = (ObserveInfo) itargetProperty;
} else {
beanObserve = (BeanObserveInfo) target;
modelProperty = (ObserveInfo) itargetProperty;
//
widgetObserve = (WidgetObserveInfo) model;
targetProperty = (ObserveInfo) imodelProperty;
}
//
if (modelProperty == beanObserve.getSelfProperty()) {
if (widgetObserve.isFormPanel()) {
FormBindingInfo formBinding = new FormBindingInfo(widgetObserve, targetProperty);
formBinding.setModel(beanObserve, modelProperty);
return formBinding;
}