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();
}
Aggregations