Class ColumnConfigurationTextRenderer<T,V>
java.lang.Object
com.vaadin.flow.data.renderer.Renderer<SOURCE>
com.vaadin.flow.data.renderer.LitRenderer<SOURCE>
com.vaadin.flow.data.renderer.ComponentRenderer<Component,SOURCE>
com.vaadin.flow.data.renderer.BasicRenderer<ITEM,ITEM>
com.vaadin.flow.data.renderer.TextRenderer<T>
com.flowingcode.vaadin.addons.easygrid.config.ColumnConfigurationTextRenderer<T,V>
- Type Parameters:
T- the grid bean typeV- the column value type
- All Implemented Interfaces:
Serializable
A
TextRenderer that formats column values using a
ColumnConfiguration. When the value is null, the configuration's null
representation is used. Otherwise, an optional formatter is applied; if none is provided,
Object.toString() is called.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionColumnConfigurationTextRenderer(ValueProvider<T, V> getter, ColumnConfiguration<V> config) Creates a renderer that falls back toObject.toString()for non-nullvalues and returns the configuration's null representation fornullvalues.ColumnConfigurationTextRenderer(ValueProvider<T, V> getter, ColumnConfiguration<V> config, SerializableBiFunction<V, ColumnConfiguration<V>, String> formatter) Creates a renderer that applies the given formatter to non-nullvalues and returns the configuration's null representation fornullvalues. -
Method Summary
Methods inherited from class com.vaadin.flow.data.renderer.TextRenderer
createComponent, createElement, getFormattedValue, getTemplateExpressionMethods inherited from class com.vaadin.flow.data.renderer.BasicRenderer
getValueProviderMethods inherited from class com.vaadin.flow.data.renderer.ComponentRenderer
render, updateComponentMethods inherited from class com.vaadin.flow.data.renderer.LitRenderer
getValueProviders, of, withFunction, withFunction, withProperty
-
Constructor Details
-
ColumnConfigurationTextRenderer
public ColumnConfigurationTextRenderer(ValueProvider<T, V> getter, ColumnConfiguration<V> config, SerializableBiFunction<V, ColumnConfiguration<V>, String> formatter) Creates a renderer that applies the given formatter to non-nullvalues and returns the configuration's null representation fornullvalues.- Parameters:
getter- a value provider that extracts the column value from a row itemconfig- the column configuration supplying the null representationformatter- a function mapping a value and its configuration to a display string, ornullto fall back toObject.toString()
-
ColumnConfigurationTextRenderer
Creates a renderer that falls back toObject.toString()for non-nullvalues and returns the configuration's null representation fornullvalues.- Parameters:
getter- a value provider that extracts the column value from a row itemconfig- the column configuration supplying the null representation
-