Search in sources :

Example 1 with XmlElementBeanBindableInfo

use of org.eclipse.wb.internal.rcp.databinding.xwt.model.beans.XmlElementBeanBindableInfo in project windowbuilder by eclipse.

the class AttributeDocumentEditor method getValue.

// //////////////////////////////////////////////////////////////////////////
// 
// 
// 
// //////////////////////////////////////////////////////////////////////////
private String getValue() throws Exception {
    StringBuffer value = new StringBuffer("{Binding ");
    // 
    if (m_binding.getModel() instanceof WidgetBindableInfo) {
        WidgetBindableInfo model = (WidgetBindableInfo) m_binding.getModel();
        String modelProperty = m_binding.getModelProperty().getPresentation().getText();
        value.append(" elementName=" + model.getReference() + ", Path=" + modelProperty);
    } else {
        BindableInfo modelProperty = (BindableInfo) m_binding.getModelProperty();
        String property = StringUtils.remove(modelProperty.getReference(), '"');
        // 
        XmlElementBeanBindableInfo model = (XmlElementBeanBindableInfo) m_binding.getModel();
        if (!model.isDataContext()) {
            property = "{StaticResource " + property + "}";
        }
        // 
        value.append(" Path=" + property);
    }
    // 
    if (m_binding.getMode() != 0) {
        value.append(", Mode=" + BindingInfo.MODES[m_binding.getMode()]);
    }
    if (m_binding.getTriger() != 0) {
        value.append(", updateSourceTrigger=" + BindingInfo.TRIGGERS[m_binding.getTriger()]);
    }
    // 
    m_binding.getConverter().appendValue(value);
    m_binding.getValidator().appendValue(value);
    // 
    value.append("}");
    // 
    return value.toString();
}
Also used : BindableInfo(org.eclipse.wb.internal.rcp.databinding.model.BindableInfo) XmlElementBeanBindableInfo(org.eclipse.wb.internal.rcp.databinding.xwt.model.beans.XmlElementBeanBindableInfo) WidgetBindableInfo(org.eclipse.wb.internal.rcp.databinding.xwt.model.widgets.WidgetBindableInfo) XmlElementBeanBindableInfo(org.eclipse.wb.internal.rcp.databinding.xwt.model.beans.XmlElementBeanBindableInfo) WidgetBindableInfo(org.eclipse.wb.internal.rcp.databinding.xwt.model.widgets.WidgetBindableInfo)

Aggregations

BindableInfo (org.eclipse.wb.internal.rcp.databinding.model.BindableInfo)1 XmlElementBeanBindableInfo (org.eclipse.wb.internal.rcp.databinding.xwt.model.beans.XmlElementBeanBindableInfo)1 WidgetBindableInfo (org.eclipse.wb.internal.rcp.databinding.xwt.model.widgets.WidgetBindableInfo)1