Package com.vaadin.flow.data.renderer
Class IconRenderer<ITEM>
- java.lang.Object
-
- com.vaadin.flow.data.renderer.Renderer<SOURCE>
-
- com.vaadin.flow.data.renderer.ComponentRenderer<com.vaadin.flow.component.Component,ITEM>
-
- com.vaadin.flow.data.renderer.IconRenderer<ITEM>
-
- Type Parameters:
ITEM- the type of the input object that can be used by the rendered component
- All Implemented Interfaces:
Serializable
public class IconRenderer<ITEM> extends ComponentRenderer<com.vaadin.flow.component.Component,ITEM>
A renderer that renders each item as a text following by an icon using provided icon generator and label generator.- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IconRenderer(com.vaadin.flow.function.SerializableFunction<ITEM,? extends com.vaadin.flow.component.Component> iconGenerator)Creates a new renderer instance using the defaultItemLabelGenerator:String::valueOfand the providediconGenerator.IconRenderer(com.vaadin.flow.function.SerializableFunction<ITEM,? extends com.vaadin.flow.component.Component> iconGenerator, com.vaadin.flow.component.ItemLabelGenerator<ITEM> itemLabelGenerator)Creates a new renderer instance using the providediconGeneratoranditemLabelGenerator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.vaadin.flow.component.ComponentcreateComponent(ITEM item)Creates a component for a given object model item.-
Methods inherited from class com.vaadin.flow.data.renderer.ComponentRenderer
render, setComponentRendererTag, updateComponent
-
Methods inherited from class com.vaadin.flow.data.renderer.Renderer
getEventHandlers, getValueProviders, render, setEventHandler, setProperty
-
-
-
-
Constructor Detail
-
IconRenderer
public IconRenderer(com.vaadin.flow.function.SerializableFunction<ITEM,? extends com.vaadin.flow.component.Component> iconGenerator)
Creates a new renderer instance using the defaultItemLabelGenerator:String::valueOfand the providediconGenerator.- Parameters:
iconGenerator- the icon component generator
-
IconRenderer
public IconRenderer(com.vaadin.flow.function.SerializableFunction<ITEM,? extends com.vaadin.flow.component.Component> iconGenerator, com.vaadin.flow.component.ItemLabelGenerator<ITEM> itemLabelGenerator)
Creates a new renderer instance using the providediconGeneratoranditemLabelGenerator.- Parameters:
iconGenerator- the icon component generatoritemLabelGenerator- the item label generator
-
-
Method Detail
-
createComponent
public com.vaadin.flow.component.Component createComponent(ITEM item)
Description copied from class:ComponentRendererCreates a component for a given object model item. Subclasses can override this method to provide specific behavior.- Overrides:
createComponentin classComponentRenderer<com.vaadin.flow.component.Component,ITEM>- Parameters:
item- the model item, possiblynull- Returns:
- a component instance representing the provided item
-
-