Package com.storedobject.vaadin
Class AbstractDataEditor.DForm
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.Component>
com.storedobject.vaadin.AbstractForm<T>
com.storedobject.vaadin.ObjectForm<T>
com.storedobject.vaadin.AbstractDataEditor.DForm
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,Serializable
- Enclosing class:
AbstractDataEditor<T>
Form to be used internally.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.vaadin.AbstractForm
AbstractForm.ValueHandler -
Field Summary
Fields inherited from class com.storedobject.vaadin.AbstractForm
container, data, objectClass, objectData -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.vaadin.flow.component.HasValue<?, ?> createField(String fieldName, Class<?> fieldType, String label) Create the field for the particular name.protected TCreate an instance of the data object.protected voidcustomizeField(String fieldName, com.vaadin.flow.component.HasValue<?, ?> field) Customize a field.protected voidGenerate field names.protected MethodgetFieldGetMethod(String fieldName) Get the field's "get" method.protected intgetFieldOrder(String fieldName) Get the order in which a field to appear in the form.protected MethodgetFieldSetMethod(String fieldName, Method getMethod) Get the field's "set" method.protected booleanhandleValueSetError(String fieldName, com.vaadin.flow.component.HasValue<?, ?> field, Object fieldValue, Object objectValue, Throwable error) Handle errors while setting (committing) values.protected booleanincludeField(String fieldName) Check whether field should be included in the form or not.Methods inherited from class com.storedobject.vaadin.ObjectForm
addField, addField, addField, addField, addField, addField, addField, addField, constructed, createField, getDataClass, getFieldNames, getLabel, getObjectClass, isFieldIncluded, setFieldCustomizer, setMethodHandlerHostMethods inherited from class com.storedobject.vaadin.AbstractForm
add, addField, addField, addFields, addIncludeFieldChecker, addValidator, addValidator, attachField, clearError, clearErrors, clearFields, commit, connect, connect, connect, createContainer, createField, detachField, dumpValues, getBinder, getColumns, getColumnSpan, getComponent, getContainer, getContent, getErrorDisplay, getField, getFieldLabel, getFieldLabel, getFieldName, getObject, getObject, getView, initContent, isFieldEditable, isFieldEditable, isFieldVisible, isFieldVisible, isReadOnly, load, markError, newLine, remove, removeAll, removeField, removeField, removeField, setColumns, setColumnSpan, setErrorDisplay, setFieldLabel, setFieldLabel, setIncludeFieldChecker, setObject, setObject, setReadOnly, setRequired, setRequired, setRequired, setRequired, setRequired, setRequired, setRequired, setRequired, setView, streamFieldNamesCreated, streamFieldsCreatedMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
DForm
-
-
Method Details
-
generateFieldNames
protected void generateFieldNames()Description copied from class:ObjectFormGenerate field names. This method is generally not overridden.- Overrides:
generateFieldNamesin classObjectForm<T>
-
getFieldGetMethod
Description copied from class:ObjectFormGet the field's "get" method. The default implementation checks for both getXXX and isXXX methods.- Overrides:
getFieldGetMethodin classObjectForm<T>- Parameters:
fieldName- Name of the field- Returns:
- Field's "get" method (if method is found, it will return
null).
-
getFieldSetMethod
Description copied from class:ObjectFormGet the field's "set" method. The default implementation checks the availability of setXXX method.- Overrides:
getFieldSetMethodin classObjectForm<T>- Parameters:
fieldName- Name of the fieldgetMethod- "get" method of this field (determined throughObjectForm.getFieldGetMethod(String))- Returns:
- Field's "set" method (if method is found, it will return
null).
-
createField
protected com.vaadin.flow.component.HasValue<?,?> createField(String fieldName, Class<?> fieldType, String label) Description copied from class:ObjectFormCreate the field for the particular name. Default implementation try to obtain the value from the "field creator" (ObjectFieldCreator.createField(String, Class, String)).- Overrides:
createFieldin classObjectForm<T>- Parameters:
fieldName- Name of the fieldfieldType- Type of the field's valuelabel- Label- Returns:
- Field
-
includeField
Description copied from class:ObjectFormCheck whether field should be included in the form or not.- Overrides:
includeFieldin classObjectForm<T>- Parameters:
fieldName- Name of the field.- Returns:
- True or false. (Default return value is
true).
-
getFieldOrder
Description copied from class:ObjectFormGet the order in which a field to appear in the form. Any integer value can be returned and the field is placed in the form in ascending order of the values returned by this method. Default implementation try to obtain the value from the "field creator" (ObjectFieldCreator.getFieldOrder(String)).- Overrides:
getFieldOrderin classObjectForm<T>- Parameters:
fieldName- Name of the field- Returns:
- Field order.
-
createObjectInstance
Create an instance of the data object. Default implementation tries to invoke the default constructor to create an instance. Fixed values will be set to the created object instance by invokingAbstractDataEditor.setFixedValues(Object).- Overrides:
createObjectInstancein classAbstractForm<T>- Returns:
- Newly created data object.
-
customizeField
Description copied from class:ObjectFormCustomize a field. This method is invoked when a field is created. One may do some customization here.- Overrides:
customizeFieldin classObjectForm<T>- Parameters:
fieldName- Name of the fieldfield- Field
-
handleValueSetError
protected boolean handleValueSetError(String fieldName, com.vaadin.flow.component.HasValue<?, ?> field, Object fieldValue, Object objectValue, Throwable error) Description copied from class:ObjectFormHandle errors while setting (committing) values. Default implementation returnstruewithout doing anything.- Overrides:
handleValueSetErrorin classObjectForm<T>- Parameters:
fieldName- Name of the fieldfield- FieldfieldValue- Field's value that's being committedobjectValue- Value currently being in the objecterror- Error occurred while setting the value- Returns:
- Whether the error situation is handled or not.
-