Package com.vaadin.flow.data.renderer
Class ComponentDataGenerator<T>
- java.lang.Object
-
- com.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>
-
- com.vaadin.flow.data.renderer.ComponentDataGenerator<T>
-
- Type Parameters:
T- the date type
- All Implemented Interfaces:
com.vaadin.flow.data.provider.DataGenerator<T>,Serializable
public class ComponentDataGenerator<T> extends com.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>ADataGeneratorthat manages the creation and passivation of components generated byComponentRenderers. It also manages the generation of thenodeIdproperty needed by theflow-component-rendererwebcomponent.This class is used internally by listing components that support ComponentRenderers.
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ComponentDataGenerator(ComponentRenderer<? extends com.vaadin.flow.component.Component,T> componentRenderer, com.vaadin.flow.function.ValueProvider<T,String> keyMapper)Creates a new generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.vaadin.flow.component.ComponentcreateComponent(T item)voidgenerateData(T item, elemental.json.JsonObject jsonObject)ComponentRenderer<? extends com.vaadin.flow.component.Component,T>getComponentRenderer()protected com.vaadin.flow.dom.ElementgetContainer()protected StringgetItemKey(T item)StringgetNodeIdPropertyName()voidsetContainer(com.vaadin.flow.dom.Element container)voidsetNodeIdPropertyName(String nodeIdPropertyName)protected com.vaadin.flow.component.ComponentupdateComponent(com.vaadin.flow.component.Component currentComponent, T item)
-
-
-
Constructor Detail
-
ComponentDataGenerator
public ComponentDataGenerator(ComponentRenderer<? extends com.vaadin.flow.component.Component,T> componentRenderer, com.vaadin.flow.function.ValueProvider<T,String> keyMapper)
Creates a new generator.- Parameters:
componentRenderer- the renderer used to produce components based on data itemskeyMapper- the DataKeyMapper used to fetch keys for items
-
-
Method Detail
-
generateData
public void generateData(T item, elemental.json.JsonObject jsonObject)
-
createComponent
protected com.vaadin.flow.component.Component createComponent(T item)
- Specified by:
createComponentin classcom.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>
-
updateComponent
protected com.vaadin.flow.component.Component updateComponent(com.vaadin.flow.component.Component currentComponent, T item)- Overrides:
updateComponentin classcom.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>
-
getItemKey
protected String getItemKey(T item)
- Specified by:
getItemKeyin classcom.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>
-
getContainer
protected com.vaadin.flow.dom.Element getContainer()
- Specified by:
getContainerin classcom.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>
-
setContainer
public void setContainer(com.vaadin.flow.dom.Element container)
-
getComponentRenderer
public ComponentRenderer<? extends com.vaadin.flow.component.Component,T> getComponentRenderer()
-
getNodeIdPropertyName
public String getNodeIdPropertyName()
-
setNodeIdPropertyName
public void setNodeIdPropertyName(String nodeIdPropertyName)
-
-