Package org.dellroad.stuff.vaadin24.util
Class SelfRenderer<T>
java.lang.Object
com.vaadin.flow.data.renderer.Renderer<SOURCE>
com.vaadin.flow.data.renderer.LitRenderer<SOURCE>
com.vaadin.flow.data.renderer.ComponentRenderer<Component,T>
org.dellroad.stuff.vaadin24.util.SelfRenderer<T>
- Type Parameters:
T
- the type of the input model object
- All Implemented Interfaces:
Serializable
A "do nothing"
ComponentRenderer
used to render values that are already Component
's.
This becomes the default renderer()
for @GridColumn
annotations
on methods that return sub-types of Component
:
public class User {
// Render username normally - no special Renderer is used
@GridColumn(header = "Username", width = "50px")
public String getUsername() { ... }
// Render status with an Image - as if we had said "renderer = SelfRenderer.class"
@GridColumn(header = "Status", width = "64px")
public Image statusColumn() { ... }
}
This class includes graceful handling of null values; null values are converted into empty Text
components.
- See Also:
-
Constructor Summary
ConstructorDescriptionSelfRenderer
(ValueProvider<? super T, ? extends Component> valueProvider) Constructor. -
Method Summary
Methods inherited from class com.vaadin.flow.data.renderer.ComponentRenderer
createComponent, getTemplateExpression, render, updateComponent
Methods inherited from class com.vaadin.flow.data.renderer.LitRenderer
getValueProviders, of, withFunction, withFunction, withProperty
-
Constructor Details
-
SelfRenderer
Constructor.- Parameters:
valueProvider
- creates a component from a model instance- Throws:
IllegalArgumentException
- ifvalueProvider
is null
-