Package com.vaadin.ui

Class 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>
    Enclosing class:
    ComboBox<T>

    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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String apply​(T item)
      Gets a class name for the item.
      protected void setStyle​(T item, java.lang.String style)
      Sets a style for the item.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Constructor Detail

      • DeclarativeStyleGenerator

        public DeclarativeStyleGenerator​(StyleGenerator<T> fallback)
    • Method Detail

      • apply

        public java.lang.String apply​(T item)
        Description copied from interface: StyleGenerator
        Gets a class name for the item.
        Specified by:
        apply in interface java.util.function.Function<T,​java.lang.String>
        Specified by:
        apply in interface StyleGenerator<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 a style for the item.
        Parameters:
        item - a data item
        style - a style for the item