java.lang.Object
io.github.mmm.ui.api.binding.data.UiDataBinding

public class UiDataBinding extends Object
Binding that allows to bind a property or an entire bean to the UI. It can create entire dialogs forms for beans dynamically.
  • Constructor Details

    • UiDataBinding

      public UiDataBinding()
      The constructor.
    • UiDataBinding

      public UiDataBinding(PropertyProvider defaultPropertyFilter)
      The constructor.
      Parameters:
      defaultPropertyFilter - the PropertyProvider to use as default.
  • Method Details

    • 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 - the ReadableBean to bind.
      receiver - the UiBindingReceiver.
      createGroup - - true to create UiFormGroups for nested beans, false otherwise.
    • bindBean

      public void bindBean(io.github.mmm.bean.ReadableBean bean, UiBindingReceiver receiver, boolean createGroup, PropertyProvider propertyProvider)
      Parameters:
      bean - the ReadableBean to bind.
      receiver - the UiBindingReceiver.
      createGroup - - true to create UiFormGroups for nested beans, false otherwise.
      propertyProvider - the PropertyProvider.
    • createFormPanel

      public <B extends io.github.mmm.bean.WritableBean> UiFormPanel<B> createFormPanel(B bean)
      Type Parameters:
      B - type of WritableBean.
      Parameters:
      bean - the WritableBean.
      Returns:
      the UiFormGroup.
    • createFormPanel

      public <B extends io.github.mmm.bean.WritableBean> UiFormPanel<B> createFormPanel(B bean, PropertyProvider propertyFilter)
      Type Parameters:
      B - type of WritableBean.
      Parameters:
      bean - the WritableBean.
      propertyFilter - the PropertyProvider.
      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 of WritableBean.
      Parameters:
      bean - the WritableBean.
      beanProperty - the ReadableBeanProperty.
      parentBean - the parent bean.
      propertyFilter - the PropertyProvider.
      Returns:
      the UiFormGroup.
    • isBindableProperty

      protected boolean isBindableProperty(io.github.mmm.property.ReadableProperty<?> property)
      Parameters:
      property - the ReadableProperty to test.
      Returns:
      true if the given property 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 the property value.
      Parameters:
      property - the ReadableProperty.
      source - the optional Object (e.g. Bean) owning the property. May be null but is required for advanced localization (if you want more specific labels in case the property name is not specific enough).
      receiver - the UiBindingReceiver. May be null.
      bindValue - true to bind the value of the ReadableProperty bidirectional with the UiInput.
      Returns:
      the UiInput widget for the given property.
    • 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 - the ReadableProperty to bind.
      input - the UiInput to bind.
      source - the optional Object (e.g. Bean) owning the property. May be null but is required for advanced localization (if you want more specific labels in case the property name is not specific enough).
      bindValue - true to bind the value of the ReadableProperty bidirectional with the UiInput.
    • createId

      protected String createId(io.github.mmm.property.ReadableProperty<?> property, Object source)
      Parameters:
      property - the ReadableProperty.
      source - the optional Object (e.g. Bean) owning the property. May be null.
      Returns:
      the widget ID.
    • localizeLabel

      protected String localizeLabel(io.github.mmm.property.ReadableProperty<?> property, Object source)
      Parameters:
      property - the ReadableProperty.
      source - the optional Object (e.g. Bean) owning the property. May be null.
      Returns:
      the localized label String.