Package com.vaadin.flow.data.renderer
Class IconRenderer<ITEM>
java.lang.Object
com.vaadin.flow.data.renderer.Renderer<SOURCE>
com.vaadin.flow.data.renderer.LitRenderer<SOURCE>
com.vaadin.flow.data.renderer.ComponentRenderer<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
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:
-
Constructor Summary
ConstructorDescriptionIconRenderer
(SerializableFunction<ITEM, ? extends Component> iconGenerator) Creates a new renderer instance using the defaultItemLabelGenerator
:String::valueOf
and the providediconGenerator
.IconRenderer
(SerializableFunction<ITEM, ? extends Component> iconGenerator, ItemLabelGenerator<ITEM> itemLabelGenerator) Creates a new renderer instance using the providediconGenerator
anditemLabelGenerator
. -
Method Summary
Modifier and TypeMethodDescriptioncreateComponent
(ITEM item) Creates a component for a given object model item.Methods inherited from class com.vaadin.flow.data.renderer.ComponentRenderer
getTemplateExpression, render, updateComponent
Methods inherited from class com.vaadin.flow.data.renderer.LitRenderer
getValueProviders, of, withFunction, withFunction, withProperty
-
Constructor Details
-
IconRenderer
Creates a new renderer instance using the defaultItemLabelGenerator
:String::valueOf
and the providediconGenerator
.- Parameters:
iconGenerator
- the icon component generator
-
IconRenderer
public IconRenderer(SerializableFunction<ITEM, ? extends Component> iconGenerator, ItemLabelGenerator<ITEM> itemLabelGenerator) Creates a new renderer instance using the providediconGenerator
anditemLabelGenerator
.- Parameters:
iconGenerator
- the icon component generatoritemLabelGenerator
- the item label generator
-
-
Method Details
-
createComponent
Description copied from class:ComponentRenderer
Creates a component for a given object model item. Subclasses can override this method to provide specific behavior.- Overrides:
createComponent
in classComponentRenderer<Component,
ITEM> - Parameters:
item
- the model item, possiblynull
- Returns:
- a component instance representing the provided item
-