Search in sources :

Example 1 with ElPropertyObserveInfo

use of org.eclipse.wb.internal.swing.databinding.model.beans.ElPropertyObserveInfo in project windowbuilder by eclipse.

the class ElPropertyInfo method getObserveProperty.

@Override
public ObserveInfo getObserveProperty(ObserveInfo observeObject) throws Exception {
    // configure observe object account with base property
    if (m_baseProperty != null) {
        Assert.instanceOf(BeanPropertyInfo.class, m_baseProperty);
        observeObject = m_baseProperty.getObserveProperty(observeObject);
    }
    // find property
    for (IObserveInfo observeProperty : observeObject.getChildren(ChildrenContext.ChildrenForPropertiesTable)) {
        if (observeProperty instanceof ElPropertyObserveInfo) {
            return (ObserveInfo) observeProperty;
        }
    }
    return null;
}
Also used : IObserveInfo(org.eclipse.wb.internal.core.databinding.model.IObserveInfo) ElPropertyObserveInfo(org.eclipse.wb.internal.swing.databinding.model.beans.ElPropertyObserveInfo) IObserveInfo(org.eclipse.wb.internal.core.databinding.model.IObserveInfo) ObserveInfo(org.eclipse.wb.internal.swing.databinding.model.ObserveInfo) ElPropertyObserveInfo(org.eclipse.wb.internal.swing.databinding.model.beans.ElPropertyObserveInfo)

Example 2 with ElPropertyObserveInfo

use of org.eclipse.wb.internal.swing.databinding.model.beans.ElPropertyObserveInfo in project windowbuilder by eclipse.

the class ChooseClassAndPropertiesUiContentProvider method handleELProperty.

// //////////////////////////////////////////////////////////////////////////
// 
// Properties
// 
// //////////////////////////////////////////////////////////////////////////
private void handleELProperty() {
    try {
        Object[] elements = m_treeViewer.getCheckedElements();
        if (m_elProperty) {
            if (elements.length == 1) {
                ObservePropertyAdapter adapter = (ObservePropertyAdapter) elements[0];
                if (adapter.getProperty() instanceof ElPropertyObserveInfo) {
                    m_elPropertyUIContentProvider.setProperty((ElPropertyInfo) convertAdapterToProperty(new BeanSupport(), m_choosenClass, adapter));
                    return;
                }
            }
            m_elProperty = false;
            m_elPropertyUIContentProvider.setProperty(null);
        } else if (elements.length == 1) {
            ObservePropertyAdapter adapter = (ObservePropertyAdapter) elements[0];
            if (adapter.getProperty() instanceof ElPropertyObserveInfo) {
                m_elProperty = true;
                m_elPropertyUIContentProvider.setProperty((ElPropertyInfo) convertAdapterToProperty(new BeanSupport(), m_choosenClass, adapter));
            }
        }
    } catch (Throwable e) {
        DesignerPlugin.log(e);
    }
}
Also used : BeanSupport(org.eclipse.wb.internal.swing.databinding.model.beans.BeanSupport) ElPropertyInfo(org.eclipse.wb.internal.swing.databinding.model.properties.ElPropertyInfo) ElPropertyObserveInfo(org.eclipse.wb.internal.swing.databinding.model.beans.ElPropertyObserveInfo)

Example 3 with ElPropertyObserveInfo

use of org.eclipse.wb.internal.swing.databinding.model.beans.ElPropertyObserveInfo in project windowbuilder by eclipse.

the class ColumnBindingUiContentProvider method handleELProperty.

private void handleELProperty() {
    IGenericType objectType = binding.getJTableBinding().getInputElementType();
    try {
        Object[] elements = treeViewer.getCheckedElements();
        if (elProperty) {
            if (elements.length == 1) {
                ObservePropertyAdapter adapter = (ObservePropertyAdapter) elements[0];
                if (adapter.getProperty() instanceof ElPropertyObserveInfo) {
                    elPropertyUIContentProvider.setProperty((ElPropertyInfo) convertAdapterToProperty(new BeanSupport(), objectType, adapter));
                    return;
                }
            }
            elProperty = false;
            elPropertyUIContentProvider.setProperty(null);
        } else if (elements.length == 1) {
            ObservePropertyAdapter adapter = (ObservePropertyAdapter) elements[0];
            if (adapter.getProperty() instanceof ElPropertyObserveInfo) {
                elProperty = true;
                elPropertyUIContentProvider.setProperty((ElPropertyInfo) convertAdapterToProperty(new BeanSupport(), objectType, adapter));
            }
        }
    } catch (Throwable e) {
        DesignerPlugin.log(e);
    }
}
Also used : IGenericType(org.eclipse.wb.internal.swing.databinding.model.generic.IGenericType) BeanSupport(org.eclipse.wb.internal.swing.databinding.model.beans.BeanSupport) ElPropertyInfo(org.eclipse.wb.internal.swing.databinding.model.properties.ElPropertyInfo) ElPropertyObserveInfo(org.eclipse.wb.internal.swing.databinding.model.beans.ElPropertyObserveInfo)

Aggregations

ElPropertyObserveInfo (org.eclipse.wb.internal.swing.databinding.model.beans.ElPropertyObserveInfo)3 BeanSupport (org.eclipse.wb.internal.swing.databinding.model.beans.BeanSupport)2 ElPropertyInfo (org.eclipse.wb.internal.swing.databinding.model.properties.ElPropertyInfo)2 IObserveInfo (org.eclipse.wb.internal.core.databinding.model.IObserveInfo)1 ObserveInfo (org.eclipse.wb.internal.swing.databinding.model.ObserveInfo)1 IGenericType (org.eclipse.wb.internal.swing.databinding.model.generic.IGenericType)1