Package org.linkki.core.ui.aspects
Class AvailableValuesAspectDefinition<C>
- java.lang.Object
-
- org.linkki.core.ui.aspects.AvailableValuesAspectDefinition<C>
-
- Type Parameters:
C- the component type
- All Implemented Interfaces:
LinkkiAspectDefinition
- Direct Known Subclasses:
GenericAvailableValuesAspectDefinition
public class AvailableValuesAspectDefinition<C> extends Object implements LinkkiAspectDefinition
Defines an aspect that updates the set of available values ofHasListDataView.
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAME-
Fields inherited from interface org.linkki.core.binding.descriptor.aspect.LinkkiAspectDefinition
DERIVED_BY_LINKKI, VALUE_ASPECT_NAME
-
-
Constructor Summary
Constructors Constructor Description AvailableValuesAspectDefinition(AvailableValuesType availableValuesType, BiConsumer<C,List<Object>> dataProviderSetter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Aspect<Collection<?>>createAspect(Class<?> valueClass)org.linkki.util.handler.HandlercreateUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper)protected AvailableValuesTypegetAvailableValuesType()TheAvailableValuesTypethat is defined in the annotation.protected <T extends Enum<T>>
List<?>getValuesDerivedFromDatatype(Class<?> valueClass)protected voidhandleNullItems(ComponentWrapper componentWrapper, List<?> items)Handlesnullvalues in the list of available values that is about to be set to the component.protected voidsetDataProvider(ComponentWrapper componentWrapper, List<Object> data)-
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
initModelUpdate, supports
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AvailableValuesAspectDefinition
public AvailableValuesAspectDefinition(AvailableValuesType availableValuesType, BiConsumer<C,List<Object>> dataProviderSetter)
-
-
Method Detail
-
createUiUpdater
public org.linkki.util.handler.Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper)
- Specified by:
createUiUpdaterin interfaceLinkkiAspectDefinition
-
createAspect
public Aspect<Collection<?>> createAspect(Class<?> valueClass)
Returns anAspectwith nameNAME. The value of thisAspectis created in dependence on the currentAvailableValuesType.- Parameters:
valueClass- is considered if the available values type is neitherAvailableValuesType.DYNAMICnorAvailableValuesType.NO_VALUESto derive theAspect's values from valueClasses data type- Returns:
- the
Aspectwith nameNAME
-
getValuesDerivedFromDatatype
@CheckForNull protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(Class<?> valueClass)
-
setDataProvider
protected void setDataProvider(ComponentWrapper componentWrapper, List<Object> data)
-
getAvailableValuesType
protected AvailableValuesType getAvailableValuesType()
TheAvailableValuesTypethat is defined in the annotation.- Returns:
- value for
AvailableValuesType
-
handleNullItems
protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items)
Handlesnullvalues in the list of available values that is about to be set to the component. By default, the items list is directly passed to theComponentWrapperwithout further processing.Note that you have to modify the given list of values directly.
- Parameters:
componentWrapper- component of which available values should be updateditems- items to be shown in theComponentWrapper. May containnull.
-
-