Package com.vaadin.ui
Class ComboBox.DeclarativeStyleGenerator<T>
- java.lang.Object
-
- com.vaadin.ui.ComboBox.DeclarativeStyleGenerator<T>
-
- Type Parameters:
T- item type
- All Implemented Interfaces:
SerializableFunction<T,java.lang.String>,StyleGenerator<T>,java.io.Serializable,java.util.function.Function<T,java.lang.String>
protected static class ComboBox.DeclarativeStyleGenerator<T> extends java.lang.Object implements StyleGenerator<T>
Item style generator class for declarative support.Provides a straightforward mapping between an item and its style.
- Since:
- 8.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DeclarativeStyleGenerator(StyleGenerator<T> fallback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringapply(T item)Gets a class name for theitem.protected voidsetStyle(T item, java.lang.String style)Sets astylefor theitem.
-
-
-
Constructor Detail
-
DeclarativeStyleGenerator
public DeclarativeStyleGenerator(StyleGenerator<T> fallback)
-
-
Method Detail
-
apply
public java.lang.String apply(T item)
Description copied from interface:StyleGeneratorGets a class name for theitem.- Specified by:
applyin interfacejava.util.function.Function<T,java.lang.String>- Specified by:
applyin interfaceStyleGenerator<T>- Parameters:
item- the item to get the class name for- Returns:
- the generated class name
-
setStyle
protected void setStyle(T item, java.lang.String style)
Sets astylefor theitem.- Parameters:
item- a data itemstyle- a style for theitem
-
-