use of org.eclipse.wb.internal.swing.databinding.model.ObserveInfo 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);
}
use of org.eclipse.wb.internal.swing.databinding.model.ObserveInfo in project windowbuilder by eclipse.
the class BeanPropertyObserveInfo method createProperty.
@Override
public PropertyInfo createProperty(ObserveInfo observeObject) throws Exception {
StringBuffer reference = new StringBuffer(getReference());
ObserveInfo parent = (ObserveInfo) getParent();
while (parent != null) {
reference.insert(0, parent.getReference() + ".");
parent = (ObserveInfo) parent.getParent();
}
return new BeanPropertyInfo(observeObject.getObjectType(), getObjectType(), null, reference.toString());
}
use of org.eclipse.wb.internal.swing.databinding.model.ObserveInfo in project windowbuilder by eclipse.
the class ChooseClassAndPropertiesUiContentProvider method convertAdapterToProperty.
private PropertyInfo convertAdapterToProperty(BeanSupport beanSupport, Class<?> objectClass, ObservePropertyAdapter adapter) throws Exception {
ClassGenericType objectType = new ClassGenericType(objectClass, null, null);
ObserveInfo observe = new SubBeanObserveInfo(beanSupport, null, objectType, StringReferenceProvider.EMPTY);
return adapter.getProperty().createProperty(observe);
}
use of org.eclipse.wb.internal.swing.databinding.model.ObserveInfo in project windowbuilder by eclipse.
the class ColumnBindingUiContentProvider method getProperties.
private List<PropertyAdapter> getProperties(IGenericType objectType) throws Exception {
List<PropertyAdapter> adapters = Lists.newArrayList();
BeanSupport beanSupport = new BeanSupport();
beanSupport.doAddELProperty(true);
for (ObserveInfo property : beanSupport.createProperties(null, objectType)) {
adapters.add(new ObservePropertyAdapter(null, property));
}
return adapters;
}
use of org.eclipse.wb.internal.swing.databinding.model.ObserveInfo in project windowbuilder by eclipse.
the class ContentAssistProcessor method createTopProperties.
private List<ObserveInfo> createTopProperties() throws Exception {
BeanSupport beanSupport = new BeanSupport();
beanSupport.doAddELProperty(false);
beanSupport.doAddSelfProperty(false);
//
List<ObserveInfo> properties = beanSupport.createProperties(null, new ClassGenericType(m_propertiesSupport.getTopLevelBean(), null, null));
return properties;
}
Aggregations