use of org.eclipse.wb.internal.swing.databinding.model.bindings.VirtualBindingInfo in project windowbuilder by eclipse.
the class DatabindingsProvider method createBinding.
public IBindingInfo createBinding(IObserveInfo target, IObserveInfo targetProperty, IObserveInfo model, IObserveInfo modelProperty) throws Exception {
// prepare ObserveInfo's
ObserveInfo targetObserve = (ObserveInfo) target;
ObserveInfo targetPropertyObserve = (ObserveInfo) targetProperty;
ObserveInfo modelObserve = (ObserveInfo) model;
ObserveInfo modelPropertyObserve = (ObserveInfo) modelProperty;
// check virtual bindings
if (targetObserve.getCreationType() == ObserveCreationType.VirtualBinding || modelObserve.getCreationType() == ObserveCreationType.VirtualBinding) {
return new VirtualBindingInfo(targetObserve, targetPropertyObserve, createProperty(targetObserve, targetPropertyObserve), modelObserve, modelPropertyObserve, createProperty(modelObserve, modelPropertyObserve));
}
// check swing bindings
if (targetObserve.getCreationType() != ObserveCreationType.AutoBinding) {
IBindingInfo binding = createSwingBinding(targetObserve, targetPropertyObserve, modelObserve, modelPropertyObserve);
if (binding != null) {
return binding;
}
}
if (modelObserve.getCreationType() != ObserveCreationType.AutoBinding) {
IBindingInfo binding = createSwingBinding(modelObserve, modelPropertyObserve, targetObserve, targetPropertyObserve);
if (binding != null) {
return binding;
}
}
// auto bindings
UpdateStrategyInfo strategy = new UpdateStrategyInfo(UpdateStrategyInfo.Value.READ);
PropertyInfo targetAstProperty = createProperty(targetObserve, targetPropertyObserve);
PropertyInfo modelAstProperty = createProperty(modelObserve, modelPropertyObserve);
//
return new AutoBindingInfo(strategy, targetObserve, targetPropertyObserve, targetAstProperty, modelObserve, modelPropertyObserve, modelAstProperty);
}
Aggregations