Class DefaultFieldGroupFieldFactory
java.lang.Object
com.vaadin.featurepack.data.fieldgroup.DefaultFieldGroupFieldFactory
- All Implemented Interfaces:
FieldGroupFieldFactory,Serializable
- Direct Known Subclasses:
FGrid.EditorFieldFactory
This class contains a basic implementation for
FieldGroupFieldFactory
.The class is singleton, use get() method to get reference to the
instance.- Author:
- Vaadin Ltd
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected booleanprotected <T extends com.vaadin.flow.component.textfield.TextFieldBase>
TcreateAbstractTextField(Class<T> fieldType) protected <T extends Field>
TcreateBooleanField(Class<T> fieldType) protected SelectcreateCompatibleSelect(Class<?> fieldType) protected <T extends Field>
TcreateDefaultField(Class<?> type, Class<T> fieldType) Fallback when no specific field has been created.<T extends Field>
TcreateField(Class<?> type, Class<T> fieldType) Creates a field based on the data type that we want to editget()Gets the singleton instance.protected voidpopulateWithEnumData(Select select, Class<? extends Enum> enumClass) Populates the given select with all the enums in the givenEnumclass.
-
Field Details
-
CAPTION_PROPERTY_ID
-
-
Constructor Details
-
DefaultFieldGroupFieldFactory
protected DefaultFieldGroupFieldFactory()
-
-
Method Details
-
get
Gets the singleton instance.- Returns:
- the singleton instance
- Since:
- 7.4
-
createField
Description copied from interface:FieldGroupFieldFactoryCreates a field based on the data type that we want to edit- Specified by:
createFieldin interfaceFieldGroupFieldFactory- Parameters:
type- The type that we want to edit using the fieldfieldType- The type of field we want to create. If set toFieldthen any type of field is accepted- Returns:
- A field that can be assigned to the given fieldType and that is capable of editing the given type of data
-
createCompatibleSelect
-
anyField
- Parameters:
fieldType- the type of the field- Returns:
- true if any AbstractField can be assigned to the field
- Since:
- 7.4
-
anySelect
- Parameters:
fieldType- the type of the field- Returns:
- true if any AbstractSelect can be assigned to the field
- Since:
- 7.4
-
createBooleanField
-
createAbstractTextField
protected <T extends com.vaadin.flow.component.textfield.TextFieldBase> T createAbstractTextField(Class<T> fieldType) -
createDefaultField
Fallback when no specific field has been created. Typically returns a TextField.- Type Parameters:
T- The type of field to create- Parameters:
type- The type of data that should be editedfieldType- The type of field to create- Returns:
- A field capable of editing the data or null if no field could be created
-
populateWithEnumData
Populates the given select with all the enums in the givenEnumclass. UsesEnum.toString() for caption.- Parameters:
select- The select to populateenumClass- The Enum class to use
-