Class FComponentRenderer<T>
java.lang.Object
com.vaadin.featurepack.ui.FGrid.AbstractGridExtension
com.vaadin.featurepack.ui.FGrid.AbstractRenderer<T>
com.vaadin.featurepack.ui.renderers.FComponentRenderer<T>
- Type Parameters:
T- the type presented by the renderer
- All Implemented Interfaces:
ClientConnector,FAbstractClientConnector,Renderer<T>,Serializable
This Renderer creates components for the value in a column. It should be used
instead of the Vaadin Flow ComponentRenderer to avoid placing the same
component in the UI multiple times, since the Context cache is made Item
based instead of value-based.
- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.featurepack.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.DetachEvent, ClientConnector.DetachListenerNested classes/interfaces inherited from interface com.vaadin.featurepack.server.FAbstractClientConnector
FAbstractClientConnector.LegacyMethodEvent -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFComponentRenderer(Class<T> presentationType, com.vaadin.flow.function.ValueProvider<T, com.vaadin.flow.component.Component> componentProvider) Constructor using value type and component provider.FComponentRenderer(Class<T> presentationType, String nullRepresentation, com.vaadin.flow.function.ValueProvider<T, com.vaadin.flow.component.Component> componentProvider) Constructor using value type and component provider. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.vaadin.flow.data.renderer.ComponentRenderer<com.vaadin.flow.component.Component, Item> createComponentRenderer(Object propertyId) Creates the component renderer using the component provider function.com.vaadin.flow.data.renderer.Renderer<T> Creates a Vaadin Flow renderer using GridRendererAdapter and ComponentRenderer in the context ofItemMethods inherited from class com.vaadin.featurepack.ui.FGrid.AbstractRenderer
getNullRepresentation, getPresentationType, getPropertyId, setPropertyIdMethods inherited from class com.vaadin.featurepack.ui.FGrid.AbstractGridExtension
getColumn, getFParent, getItemId, getItemId, getParentGrid, refreshRow, setParentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.featurepack.server.ClientConnector
getFParentMethods inherited from interface com.vaadin.featurepack.server.FAbstractClientConnector
addLegacyAttachListener, addLegacyDetachListener, addListener, addListener, attach, beforeClientResponse, detach, doConnectorOnAttach, doConnectorOnDetach, fireEvent, fireEvent, getAllChildrenIterable, getFListeners, getFlowComponent, getResource, hasListeners, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeListener, removeListener, setResource
-
Field Details
-
renderer
-
-
Constructor Details
-
FComponentRenderer
public FComponentRenderer(Class<T> presentationType, com.vaadin.flow.function.ValueProvider<T, com.vaadin.flow.component.Component> componentProvider) Constructor using value type and component provider. Null representation will be defaulted tonull.- Parameters:
presentationType- type of the column valuecomponentProvider- component provider function
-
FComponentRenderer
public FComponentRenderer(Class<T> presentationType, String nullRepresentation, com.vaadin.flow.function.ValueProvider<T, com.vaadin.flow.component.Component> componentProvider) Constructor using value type and component provider.- Parameters:
presentationType- type of the column valuenullRepresentation- value of null representationcomponentProvider- component provider function
-
-
Method Details
-
getRenderer
Creates a Vaadin Flow renderer using GridRendererAdapter and ComponentRenderer in the context ofItem- Returns:
- Flow column renderer
-
createComponentRenderer
protected com.vaadin.flow.data.renderer.ComponentRenderer<com.vaadin.flow.component.Component,Item> createComponentRenderer(Object propertyId) Creates the component renderer using the component provider function. In case the item or the value or converted value is null, it Will create a span with null representation text.- Returns:
- Component renderer which uses the component provider function or a span with null representation if the value is null.
-