T - the date typepublic class ComponentDataGenerator<T>
extends com.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>
DataGenerator that
manages the creation and passivation of components generated by
ComponentRenderers. It also manages the generation of the
nodeId property needed by the flow-component-renderer
webcomponent.
This class is used internally by listing components that support ComponentRenderers.
| Constructor and Description |
|---|
ComponentDataGenerator(ComponentRenderer<? extends com.vaadin.flow.component.Component,T> componentRenderer,
com.vaadin.flow.function.ValueProvider<T,String> keyMapper)
Creates a new generator.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.vaadin.flow.component.Component |
createComponent(T item) |
void |
generateData(T item,
elemental.json.JsonObject jsonObject) |
ComponentRenderer<? extends com.vaadin.flow.component.Component,T> |
getComponentRenderer() |
protected com.vaadin.flow.dom.Element |
getContainer() |
protected String |
getItemKey(T item) |
String |
getNodeIdPropertyName() |
void |
setContainer(com.vaadin.flow.dom.Element container) |
void |
setNodeIdPropertyName(String nodeIdPropertyName) |
protected com.vaadin.flow.component.Component |
updateComponent(com.vaadin.flow.component.Component currentComponent,
T item) |
public ComponentDataGenerator(ComponentRenderer<? extends com.vaadin.flow.component.Component,T> componentRenderer, com.vaadin.flow.function.ValueProvider<T,String> keyMapper)
componentRenderer - the renderer used to produce components based on data itemskeyMapper - the DataKeyMapper used to fetch keys for itemspublic void generateData(T item, elemental.json.JsonObject jsonObject)
protected com.vaadin.flow.component.Component createComponent(T item)
createComponent in class com.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>protected com.vaadin.flow.component.Component updateComponent(com.vaadin.flow.component.Component currentComponent,
T item)
updateComponent in class com.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>protected String getItemKey(T item)
getItemKey in class com.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>protected com.vaadin.flow.dom.Element getContainer()
getContainer in class com.vaadin.flow.data.provider.AbstractComponentDataGenerator<T>public void setContainer(com.vaadin.flow.dom.Element container)
public ComponentRenderer<? extends com.vaadin.flow.component.Component,T> getComponentRenderer()
public String getNodeIdPropertyName()
public void setNodeIdPropertyName(String nodeIdPropertyName)
Copyright © 2022. All rights reserved.