Class EasyGrid<T>

Type Parameters:
T - the grid bean type
All Implemented Interfaces:
AttachNotifier, BlurNotifier<Grid<T>>, DetachNotifier, Focusable<Grid<T>>, FocusNotifier<Grid<T>>, HasElement, HasEnabled, HasSize, HasStyle, HasTheme, HasDataGenerators<T>, HasDataView<T,Void,GridDataView<T>>, HasLazyDataView<T,Void,GridLazyDataView<T>>, HasListDataView<T,GridListDataView<T>>, Serializable

public class EasyGrid<T> extends EasyGridWrapper<T,Grid<T>>
Concrete EasyGridWrapper that always wraps a plain Grid, creating it internally. This is the standard entry point for using the Easy Grid Add-on.
See Also:
  • Constructor Details

    • EasyGrid

      public EasyGrid(@NonNull @NonNull Class<T> beanType)
      Creates an EasyGrid that discovers all top-level bean properties and adds a column for each.
      Parameters:
      beanType - the bean type to use, not null
      Throws:
      NullPointerException - if beanType is null
    • EasyGrid

      public EasyGrid(@NonNull @NonNull Class<T> beanType, boolean autoCreateColumns)
      Creates an EasyGrid for the given bean type, optionally auto-creating columns.
      Parameters:
      beanType - the bean type to use, not null
      autoCreateColumns - when true, columns are created automatically for the properties of the bean type
      Throws:
      NullPointerException - if beanType is null
    • EasyGrid

      public EasyGrid(@NonNull @NonNull Class<T> beanType, String... propertyNames)
      Creates an EasyGrid that adds columns for the specified properties in order.
      Parameters:
      beanType - the bean type to use, not null
      propertyNames - the names of the properties for which columns are created
      Throws:
      NullPointerException - if beanType or propertyNames is null
  • Method Details

    • initContent

      protected Grid<T> initContent()
      Overrides:
      initContent in class Composite<GRID extends Grid<T>>
    • getWrappedGrid

      public final Grid<T> getWrappedGrid()
      Returns the wrapped grid.
      Returns:
      the wrapped grid, never null
    • configure

      public void configure(Consumer<Grid<T>> customizer)
      Passes the wrapped grid to the given customizer, allowing direct configuration of the grid.
      Parameters:
      customizer - a consumer that configures the wrapped grid