Package org.linkki.core.ui.aspects
Class ValueAspectDefinition
- java.lang.Object
-
- org.linkki.core.ui.aspects.ValueAspectDefinition
-
- All Implemented Interfaces:
LinkkiAspectDefinition
- Direct Known Subclasses:
PrimitiveAwareValueAspectDefinition,UIYesNoComboBox.YesNoComboBoxValueAspectDefinition
public class ValueAspectDefinition extends Object implements LinkkiAspectDefinition
Aspect definition for value change. Defines that the data source will get/set values throughAspectsby providing a handler ininitModelUpdate(PropertyDispatcher, ComponentWrapper, Handler).This aspect definition does not use any converter. Extend this class and override
getConverter(Type, Type)to add converters to the field.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMSG_CODE_INVALID_INPUTstatic StringNAME-
Fields inherited from interface org.linkki.core.binding.descriptor.aspect.LinkkiAspectDefinition
DERIVED_BY_LINKKI, VALUE_ASPECT_NAME
-
-
Constructor Summary
Constructors Constructor Description ValueAspectDefinition()ValueAspectDefinition(com.vaadin.flow.data.converter.Converter<?,?> converter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.linkki.util.handler.HandlercreateUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper)protected com.vaadin.flow.data.converter.Converter<?,?>getConverter(Type presentationType, Type modelType)Returns a converter that should be used to convert a value of model type to a value of presentation type.protected MessageListgetInvalidInputMessage(Object value)Warns the user that the user input is not set due to conversion error.protected com.vaadin.flow.data.binder.ValueContextgetValueContext(com.vaadin.flow.component.HasValue<?,Object> source)voidinitModelUpdate(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper, org.linkki.util.handler.Handler modelUpdated)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.linkki.core.binding.descriptor.aspect.LinkkiAspectDefinition
supports
-
-
-
-
Field Detail
-
MSG_CODE_INVALID_INPUT
public static final String MSG_CODE_INVALID_INPUT
- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
initModelUpdate
public void initModelUpdate(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper, org.linkki.util.handler.Handler modelUpdated)
- Specified by:
initModelUpdatein interfaceLinkkiAspectDefinition
-
getInvalidInputMessage
protected MessageList getInvalidInputMessage(@CheckForNull Object value)
Warns the user that the user input is not set due to conversion error.
-
createUiUpdater
public org.linkki.util.handler.Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper)
- Specified by:
createUiUpdaterin interfaceLinkkiAspectDefinition
-
getValueContext
protected com.vaadin.flow.data.binder.ValueContext getValueContext(com.vaadin.flow.component.HasValue<?,Object> source)
-
getConverter
protected com.vaadin.flow.data.converter.Converter<?,?> getConverter(Type presentationType, Type modelType)
Returns a converter that should be used to convert a value of model type to a value of presentation type. Note that the presentation type should match the value type of the input field.Uses
Converter.identity()by default. Override to add converters.- Parameters:
presentationType- value type of the input fieldmodelType- the model type- Returns:
- a converter from model type to presentation type
- See Also:
LinkkiConverterRegistry
-
-