com.vaadin.flow.data.renderer.
Class TextRenderer<ITEM>
- java.lang.Object
-
- com.vaadin.flow.data.renderer.Renderer<SOURCE>
-
- com.vaadin.flow.data.renderer.ComponentRenderer<Component,ITEM>
-
- com.vaadin.flow.data.renderer.TextRenderer<ITEM>
-
Type Parameters:
ITEM
- the type of the input object that can be used by the rendered componentAll Implemented Interfaces:
public class TextRenderer<ITEM> extends ComponentRenderer<Component,ITEM>
A renderer that renders each item as a text using provided
ItemLabelGenerator
.Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor Description TextRenderer()
Creates a new renderer instance using the default
ItemLabelGenerator
:String::valueOf
.TextRenderer(ItemLabelGenerator<ITEM> itemLabelGenerator)
Creates a new renderer instance using the provided
itemLabelGenerator
.
-
Method Summary
All Methods Modifier and Type Method Description Component
createComponent(ITEM item)
Creates a component for a given object model item.
protected Element
createElement(String item)
Creates a new
Element
that represent the rendereditem
.-
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
-
TextRenderer
public TextRenderer()
Creates a new renderer instance using the default
ItemLabelGenerator
:String::valueOf
.
-
TextRenderer
public TextRenderer(ItemLabelGenerator<ITEM> itemLabelGenerator)
Creates a new renderer instance using the provided
itemLabelGenerator
.Parameters:
itemLabelGenerator
- the item label generator
-
-
Method Detail
-
createComponent
public Component createComponent(ITEM item)
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
-
createElement
protected Element createElement(String item)
Creates a new
Element
that represent the rendereditem
.By default the text is wrapped inside a
<span>
element. Subclasses may override this method to return some otherElement
.Parameters:
item
- the item to renderReturns:
the element representing rendered item
-
-