public interface PropertyInputGroup extends PropertyInputBinder, ValueHolder<com.holonplatform.core.property.PropertyBox>, Validatable
Inputs bound to a Property set, loading and obtaining property values in
and from Inputs using the PropertyBox data container type.
Supports overall Validators registration to validate all the Input values, allowing cross input
validation, using a PropertyBox to represent the inputs value set.
By default, property Input components are obtained from the PropertyRenderers registered in the
context PropertyRendererRegistry, if available. Custom PropertyRenderer registration is supported to
provide a custom behaviour for specific properties.
Default property values are supported using a PropertyInputGroup.DefaultValueProvider. The property default values are loaded
when ValueHolder.clear() or setValue(PropertyBox) methods are invoked.
Convenience methods setEnabled(boolean) and setReadOnly(boolean) can be used to change the enabled
/ read-only state for all the property bound Inputs.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
PropertyInputGroup.Builder<G extends PropertyInputGroup,B extends PropertyInputGroup.Builder<G,B>>
Base
PropertyInputGroup builder. |
static interface |
PropertyInputGroup.DefaultValueProvider<T>
Interface to provide the default value for a
Property. |
static class |
PropertyInputGroup.OverallValidationException
Validator.ValidationException extension to discern inputs validation and overall container validation exceptions. |
static interface |
PropertyInputGroup.PropertyInputGroupBuilder
PropertyInputGroup builder. |
PropertyInputBinder.PropertyInputValueChangeListener<V>ValueHolder.MaySupportValueChangeMode, ValueHolder.ValueChangeEvent<V>, ValueHolder.ValueChangeListener<V>| Modifier and Type | Method and Description |
|---|---|
static PropertyInputGroup.PropertyInputGroupBuilder |
builder()
Get a
PropertyInputGroup.Builder to create and setup a PropertyInputGroup. |
default com.holonplatform.core.property.PropertyBox |
getValue()
Get the current property values collected into a
PropertyBox, using the group configured properties as
property set. |
com.holonplatform.core.property.PropertyBox |
getValue(boolean validate)
Get the current property values collected into a
PropertyBox, using the group configured properties as
property set. |
Optional<com.holonplatform.core.property.PropertyBox> |
getValueIfValid()
Get the current property values collected into a
PropertyBox, using the group configured properties as
property set, only if the property bound Inputs and this PropertyInputGroup are valid
For each property with a bound Input component, the property value is obtained from the Input
component through the ValueHolder.getValue() method. |
void |
setEnabled(boolean enabled)
Updates the enabled state of all the group inputs.
|
void |
setReadOnly(boolean readOnly)
Set the read-only mode for all the group inputs.
|
default void |
setValue(com.holonplatform.core.property.PropertyBox propertyBox)
Set the current property values using a
PropertyBox, loading the values to the available property bound
Inputs through the ValueHolder.setValue(Object) method. |
void |
setValue(com.holonplatform.core.property.PropertyBox propertyBox,
boolean validate)
Set the current property values using a
PropertyBox, loading the values to the available property bound
Inputs through the ValueHolder.setValue(Object) method. |
getInput, getInputs, refresh, refresh, refresh, requireInput, streamgetProperties, hasProperty, propertyStreamaddValueChangeListener, clear, getEmptyValue, getOptionalValue, getValueIfPresent, isEmptyisValid, validatecom.holonplatform.core.property.PropertyBox getValue(boolean validate)
PropertyBox, using the group configured properties as
property set.
For each property with a bound Input component, the property value is obtained from the Input
component through the ValueHolder.getValue() method.
validate - true to check the validity of the property bound Inputs and of this
PropertyInputGroup before returing the value, throwing a Validator.ValidationException if the
validation is not successful.PropertyBox containing the property values (never null)com.holonplatform.core.Validator.ValidationException - If validate is true and an Input value is not validPropertyInputGroup.OverallValidationException - If the overall validation faileddefault com.holonplatform.core.property.PropertyBox getValue()
PropertyBox, using the group configured properties as
property set.
For each property with a bound Input component, the property value is obtained from the Input
component through the ValueHolder.getValue() method.
The available Inputs and the overall group validation is performed before returning the value, throwing a
Validator.ValidationException if the validation is not successful.
getValue in interface ValueHolder<com.holonplatform.core.property.PropertyBox>PropertyBox containing the property values (never null)com.holonplatform.core.Validator.ValidationException - If one or more input value is not valid, providing the validation error messagesPropertyInputGroup.OverallValidationException - If the overall validation failedgetValue(boolean),
getValueIfValid()Optional<com.holonplatform.core.property.PropertyBox> getValueIfValid()
PropertyBox, using the group configured properties as
property set, only if the property bound Inputs and this PropertyInputGroup are valid
For each property with a bound Input component, the property value is obtained from the Input
component through the ValueHolder.getValue() method.
PropertyBox containing the property values, or an empty Optional if validation failedvoid setValue(com.holonplatform.core.property.PropertyBox propertyBox,
boolean validate)
PropertyBox, loading the values to the available property bound
Inputs through the ValueHolder.setValue(Object) method.
Only the properties which belong to the group's property set are taken into account.
propertyBox - the PropertyBox which contains the property values to load. If null, all
the Input components are cleared.validate - true to check the validity of the property bound Inputs and of this
PropertyInputGroup, throwing a Validator.ValidationException if the validation is not successful.com.holonplatform.core.Validator.ValidationException - If validate is true and an Input value is not validPropertyInputGroup.OverallValidationException - If overall validation faileddefault void setValue(com.holonplatform.core.property.PropertyBox propertyBox)
PropertyBox, loading the values to the available property bound
Inputs through the ValueHolder.setValue(Object) method.
Only the properties which belong to the group's property set are taken into account.
By default, no value validation is performed using this method.
setValue in interface ValueHolder<com.holonplatform.core.property.PropertyBox>propertyBox - the PropertyBox which contains the property values to load. If null, all
the Input components are cleared.setValue(PropertyBox, boolean)void setReadOnly(boolean readOnly)
readOnly - true to set all inputs as read-only, false to unsetvoid setEnabled(boolean enabled)
enabled - true to enable all group inputs, false to disable themstatic PropertyInputGroup.PropertyInputGroupBuilder builder()
PropertyInputGroup.Builder to create and setup a PropertyInputGroup.PropertyInputGroup builderCopyright © 2019 The Holon Platform. All rights reserved.