Class EasyColumn<T,V>

java.lang.Object
com.flowingcode.vaadin.addons.easygrid.EasyColumn<T,V>
Type Parameters:
T - the grid bean type
V - the column value type
All Implemented Interfaces:
IEasyGridColumn<T,V>, Serializable

public final class EasyColumn<T,V> extends Object implements IEasyGridColumn<T,V>, Serializable
Wraps a Grid.Column and provides type-specific formatting for an EasyGridAddon-managed column.
See Also:
  • Method Details

    • as

      public <S> EasyColumn<T,S> as(Class<S> type)
      Returns this column cast to value type S, analogously to Class.asSubclass(java.lang.Class<U>). Succeeds when the column's actual value type is a subtype of S; throws otherwise.
      Type Parameters:
      S - the target value type
      Parameters:
      type - the target value type class
      Returns:
      this column cast to EasyColumn<T, S>
      Throws:
      ClassCastException - if the column's actual value type is not a subtype of type
    • setNullRepresentation

      public EasyColumn<T,V> setNullRepresentation(String nullRepresentation)
      Sets the string to display when the column value is null. Overrides any null representation inherited from the type or global configuration. Updates the underlying configuration and re-applies the renderer.
      Parameters:
      nullRepresentation - the string to show for null values
      Returns:
      this column, for fluent chaining
    • setFormatter

      public EasyColumn<T,V> setFormatter(SerializableFunction<V,String> formatter)
      Sets a custom formatter that converts the column value to a display string. Overrides any type-specific or formatter-based renderer inherited from the configuration chain.
      Parameters:
      formatter - a function mapping a column value to its display string
      Returns:
      this column, for fluent chaining
    • setRendererFactory

      public EasyColumn<T,V> setRendererFactory(RendererFactory<T,V> rendererFactory)
      Sets a custom renderer factory for this column. Overrides any type-specific or formatter-based renderer inherited from the configuration chain.
      Parameters:
      rendererFactory - a factory that creates a renderer from a value provider
      Returns:
      this column, for fluent chaining
    • setTextAlign

      public EasyColumn<T,V> setTextAlign(ColumnTextAlign textAlign)
      Sets the text alignment for this column's cells. Updates both the underlying Grid.Column and the ColumnConfiguration.
      Specified by:
      setTextAlign in interface IEasyGridColumn<T,V>
      Parameters:
      textAlign - the text alignment to apply
      Returns:
      this column, for fluent chaining