Class DefaultPropertyGroupLayoutProvider
java.lang.Object
org.vaadin.miki.superfields.object.DefaultPropertyGroupLayoutProvider
- All Implemented Interfaces:
Serializable,PropertyGroupLayoutProvider
public class DefaultPropertyGroupLayoutProvider
extends Object
implements PropertyGroupLayoutProvider
Default implementation of
PropertyGroupLayoutProvider.
When a group consists of 2 or more elements, it returns a layout for it. Otherwise, it returns no layout.- Since:
- 2022-09-01
- Author:
- miki
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPropertyGroupLayoutProvider(com.vaadin.flow.function.SerializableSupplier<C> newLayoutProvider) -
Method Summary
Modifier and TypeMethodDescription<T,C extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents>
Optional<C>buildGroupLayout(String groupName, List<Property<T, ?>> definitions) Builds a layout for a given group.
-
Constructor Details
-
DefaultPropertyGroupLayoutProvider
public DefaultPropertyGroupLayoutProvider() -
DefaultPropertyGroupLayoutProvider
public DefaultPropertyGroupLayoutProvider(com.vaadin.flow.function.SerializableSupplier<C> newLayoutProvider)
-
-
Method Details
-
buildGroupLayout
public <T,C extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasComponents> Optional<C> buildGroupLayout(String groupName, List<Property<T, ?>> definitions) Description copied from interface:PropertyGroupLayoutProviderBuilds a layout for a given group.- Specified by:
buildGroupLayoutin interfacePropertyGroupLayoutProvider- Type Parameters:
T- Type of the object inPropertys.C- Type to ensure the returned object is both aComponentthatHasComponents.- Parameters:
groupName- Name of the group.definitions- A list ofPropertys within the group.- Returns:
- A layout for the group, if any needed. An empty
Optionalmeans the corresponding components will be added to the main layout of the parent component instead.
-