Search in sources :

Example 1 with JComboBoxBindingInfo

use of org.eclipse.wb.internal.swing.databinding.model.bindings.JComboBoxBindingInfo in project windowbuilder by eclipse.

the class DatabindingsProvider method createSwingBinding.

private IBindingInfo createSwingBinding(ObserveInfo component, ObserveInfo componentProperty, ObserveInfo model, ObserveInfo modelProperty) throws Exception {
    // check swing binding type
    if (componentProperty.getCreationType() != ObserveCreationType.SelfProperty) {
        return null;
    }
    if (modelProperty.getCreationType() != ObserveCreationType.ListSelfProperty && modelProperty.getCreationType() != ObserveCreationType.ListProperty) {
        return null;
    }
    // create strategy
    UpdateStrategyInfo strategy = new UpdateStrategyInfo(UpdateStrategyInfo.Value.READ);
    // create properties
    PropertyInfo componentAstProperty = createProperty(component, componentProperty);
    PropertyInfo modelAstProperty = createProperty(model, modelProperty);
    // create binding
    switch(component.getCreationType()) {
        case JListBinding:
            return new JListBindingInfo(strategy, component, componentProperty, componentAstProperty, model, modelProperty, modelAstProperty);
        case JTableBinding:
            return new JTableBindingInfo(strategy, component, componentProperty, componentAstProperty, model, modelProperty, modelAstProperty);
        case JComboBoxBinding:
            return new JComboBoxBindingInfo(strategy, component, componentProperty, componentAstProperty, model, modelProperty, modelAstProperty);
    }
    // 
    return null;
}
Also used : UpdateStrategyInfo(org.eclipse.wb.internal.swing.databinding.model.bindings.UpdateStrategyInfo) JComboBoxBindingInfo(org.eclipse.wb.internal.swing.databinding.model.bindings.JComboBoxBindingInfo) PropertyInfo(org.eclipse.wb.internal.swing.databinding.model.properties.PropertyInfo) JTableBindingInfo(org.eclipse.wb.internal.swing.databinding.model.bindings.JTableBindingInfo) JListBindingInfo(org.eclipse.wb.internal.swing.databinding.model.bindings.JListBindingInfo)

Aggregations

JComboBoxBindingInfo (org.eclipse.wb.internal.swing.databinding.model.bindings.JComboBoxBindingInfo)1 JListBindingInfo (org.eclipse.wb.internal.swing.databinding.model.bindings.JListBindingInfo)1 JTableBindingInfo (org.eclipse.wb.internal.swing.databinding.model.bindings.JTableBindingInfo)1 UpdateStrategyInfo (org.eclipse.wb.internal.swing.databinding.model.bindings.UpdateStrategyInfo)1 PropertyInfo (org.eclipse.wb.internal.swing.databinding.model.properties.PropertyInfo)1