- java.lang.Object
-
- io.github.mmm.ui.api.binding.data.UiDataBinding
-
public class UiDataBinding extends Object
Binding that allows to bind aproperty
or an entirebean
to 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 void
bindBean(io.github.mmm.bean.ReadableBean bean, UiBindingReceiver receiver, boolean createGroup)
void
bindBean(io.github.mmm.bean.ReadableBean bean, UiBindingReceiver receiver, boolean createGroup, PropertyProvider propertyProvider)
<V> void
bindProperty(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 String
createId(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 boolean
isBindableProperty(io.github.mmm.property.ReadableProperty<?> property)
protected String
localizeLabel(io.github.mmm.property.ReadableProperty<?> property, Object source)
-
-
-
Constructor Detail
-
UiDataBinding
public UiDataBinding()
The constructor.
-
UiDataBinding
public UiDataBinding(PropertyProvider defaultPropertyFilter)
The constructor.- Parameters:
defaultPropertyFilter
- thePropertyProvider
to 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
- theReadableBean
to bind.receiver
- theUiBindingReceiver
.createGroup
- -true
to createUiFormGroup
s for nested beans,false
otherwise.
-
bindBean
public void bindBean(io.github.mmm.bean.ReadableBean bean, UiBindingReceiver receiver, boolean createGroup, PropertyProvider propertyProvider)
- Parameters:
bean
- theReadableBean
to bind.receiver
- theUiBindingReceiver
.createGroup
- -true
to createUiFormGroup
s for nested beans,false
otherwise.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
- theReadableProperty
to test.- Returns:
true
if the givenproperty
should be bound to the UI,false
otherwise.
-
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 benull
but is required for advanced localization (if you want more specific labels in case theproperty name
is not specific enough).receiver
- theUiBindingReceiver
. May benull
.bindValue
-true
to bind the value of theReadableProperty
bidirectional with theUiInput
.- Returns:
- the
UiInput
widget 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
- theReadableProperty
to bind.input
- theUiInput
to bind.source
- the optionalObject
(e.g.Bean
) owning the property. May benull
but is required for advanced localization (if you want more specific labels in case theproperty name
is not specific enough).bindValue
-true
to bind the value of theReadableProperty
bidirectional 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.
-
-