Class SelfRenderer<T>

Type Parameters:
T - the type of the input model object
All Implemented Interfaces:
Serializable

public class SelfRenderer<T> extends ComponentRenderer<Component,T>
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 Details

    • SelfRenderer

      public SelfRenderer(ValueProvider<? super T,? extends Component> valueProvider)
      Constructor.
      Parameters:
      valueProvider - creates a component from a model instance
      Throws:
      IllegalArgumentException - if valueProvider is null