- java.lang.Object
-
- io.github.mmm.ui.api.binding.data.UiDataBinding
-
public class UiDataBinding extends Object
Binding that allows to bind apropertyor an entirebeanto the UI. It can create entire dialogs forms for beans dynamically.
-
-
Constructor Summary
Constructors Constructor Description UiDataBinding()The constructor.UiDataBinding(PropertyProvider defaultPropertyFilter)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindBean(io.github.mmm.bean.ReadableBean bean, UiBindingReceiver receiver, boolean createGroup)voidbindBean(io.github.mmm.bean.ReadableBean bean, UiBindingReceiver receiver, boolean createGroup, PropertyProvider propertyProvider)<V> voidbindProperty(io.github.mmm.property.ReadableProperty<V> property, io.github.mmm.ui.api.widget.input.UiInput<V> input, Object source, boolean bindValue)<B extends io.github.mmm.bean.ReadableBean>
io.github.mmm.ui.api.widget.value.UiValidatableWidget<B>createEditor(B bean)<B extends io.github.mmm.bean.ReadableBean>
io.github.mmm.ui.api.widget.value.UiValidatableWidget<B>createEditor(B bean, int columns)<B extends io.github.mmm.bean.WritableBean>
UiFormGroup<B>createFormGroup(B bean, io.github.mmm.bean.property.ReadableBeanProperty<B> beanProperty, io.github.mmm.bean.ReadableBean parentBean, PropertyProvider propertyFilter)<B extends io.github.mmm.bean.WritableBean>
UiFormPanel<B>createFormPanel(B bean)<B extends io.github.mmm.bean.WritableBean>
UiFormPanel<B>createFormPanel(B bean, PropertyProvider propertyFilter)protected StringcreateId(io.github.mmm.property.ReadableProperty<?> property, Object source)<V> io.github.mmm.ui.api.widget.input.UiInput<V>createInput(io.github.mmm.property.ReadableProperty<V> property, Object source, UiBindingReceiver receiver, boolean bindValue)protected booleanisBindableProperty(io.github.mmm.property.ReadableProperty<?> property)protected StringlocalizeLabel(io.github.mmm.property.ReadableProperty<?> property, Object source)
-
-
-
Constructor Detail
-
UiDataBinding
public UiDataBinding()
The constructor.
-
UiDataBinding
public UiDataBinding(PropertyProvider defaultPropertyFilter)
The constructor.- Parameters:
defaultPropertyFilter- thePropertyProviderto use as default.
-
-
Method Detail
-
createEditor
public <B extends io.github.mmm.bean.ReadableBean> io.github.mmm.ui.api.widget.value.UiValidatableWidget<B> createEditor(B bean)
-
createEditor
public <B extends io.github.mmm.bean.ReadableBean> io.github.mmm.ui.api.widget.value.UiValidatableWidget<B> createEditor(B bean, int columns)
-
bindBean
public void bindBean(io.github.mmm.bean.ReadableBean bean, UiBindingReceiver receiver, boolean createGroup)- Parameters:
bean- theReadableBeanto bind.receiver- theUiBindingReceiver.createGroup- -trueto createUiFormGroups for nested beans,falseotherwise.
-
bindBean
public void bindBean(io.github.mmm.bean.ReadableBean bean, UiBindingReceiver receiver, boolean createGroup, PropertyProvider propertyProvider)- Parameters:
bean- theReadableBeanto bind.receiver- theUiBindingReceiver.createGroup- -trueto createUiFormGroups for nested beans,falseotherwise.propertyProvider- thePropertyProvider.
-
createFormPanel
public <B extends io.github.mmm.bean.WritableBean> UiFormPanel<B> createFormPanel(B bean)
- Type Parameters:
B- type ofWritableBean.- Parameters:
bean- theWritableBean.- Returns:
- the
UiFormGroup.
-
createFormPanel
public <B extends io.github.mmm.bean.WritableBean> UiFormPanel<B> createFormPanel(B bean, PropertyProvider propertyFilter)
- Type Parameters:
B- type ofWritableBean.- Parameters:
bean- theWritableBean.propertyFilter- thePropertyProvider.- Returns:
- the
UiFormGroup.
-
createFormGroup
public <B extends io.github.mmm.bean.WritableBean> UiFormGroup<B> createFormGroup(B bean, io.github.mmm.bean.property.ReadableBeanProperty<B> beanProperty, io.github.mmm.bean.ReadableBean parentBean, PropertyProvider propertyFilter)
- Type Parameters:
B- type ofWritableBean.- Parameters:
bean- theWritableBean.beanProperty- theReadableBeanProperty.parentBean- the parentbean.propertyFilter- thePropertyProvider.- Returns:
- the
UiFormGroup.
-
isBindableProperty
protected boolean isBindableProperty(io.github.mmm.property.ReadableProperty<?> property)
- Parameters:
property- theReadablePropertyto test.- Returns:
trueif the givenpropertyshould be bound to the UI,falseotherwise.
-
createInput
public <V> io.github.mmm.ui.api.widget.input.UiInput<V> createInput(io.github.mmm.property.ReadableProperty<V> property, Object source, UiBindingReceiver receiver, boolean bindValue)- Type Parameters:
V- type of theproperty value.- Parameters:
property- theReadableProperty.source- the optionalObject(e.g.Bean) owning the property. May benullbut is required for advanced localization (if you want more specific labels in case theproperty nameis not specific enough).receiver- theUiBindingReceiver. May benull.bindValue-trueto bind the value of theReadablePropertybidirectional with theUiInput.- Returns:
- the
UiInputwidget for the givenproperty.
-
bindProperty
public <V> void bindProperty(io.github.mmm.property.ReadableProperty<V> property, io.github.mmm.ui.api.widget.input.UiInput<V> input, Object source, boolean bindValue)- Type Parameters:
V- type of the value.- Parameters:
property- theReadablePropertyto bind.input- theUiInputto bind.source- the optionalObject(e.g.Bean) owning the property. May benullbut is required for advanced localization (if you want more specific labels in case theproperty nameis not specific enough).bindValue-trueto bind the value of theReadablePropertybidirectional with theUiInput.
-
createId
protected String createId(io.github.mmm.property.ReadableProperty<?> property, Object source)
- Parameters:
property- theReadableProperty.source- the optionalObject(e.g.Bean) owning the property. May benull.- Returns:
- the widget ID.
-
-