Package com.vaadin.flow.data.renderer
Class TextRenderer<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.TextRenderer<ITEM>
-
- Type Parameters:
ITEM- the type of the input object that can be used by the rendered component
- All Implemented Interfaces:
Serializable
public class TextRenderer<ITEM> extends ComponentRenderer<com.vaadin.flow.component.Component,ITEM>
A renderer that renders each item as a text using providedItemLabelGenerator.- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TextRenderer()Creates a new renderer instance using the defaultItemLabelGenerator:String::valueOf.TextRenderer(com.vaadin.flow.component.ItemLabelGenerator<ITEM> itemLabelGenerator)Creates a new renderer instance using the provideditemLabelGenerator.
-
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.protected com.vaadin.flow.dom.ElementcreateElement(String item)Creates a newElementthat 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 defaultItemLabelGenerator:String::valueOf.
-
TextRenderer
public TextRenderer(com.vaadin.flow.component.ItemLabelGenerator<ITEM> itemLabelGenerator)
Creates a new renderer instance using the provideditemLabelGenerator.- Parameters:
itemLabelGenerator- 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
-
createElement
protected com.vaadin.flow.dom.Element createElement(String item)
Creates a newElementthat 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 render- Returns:
- the element representing rendered item
-
-