Interface IEasyGridComposite<T>

Type Parameters:
T - the grid bean type

public sealed interface IEasyGridComposite<T>
Defines the subset of Grid methods that EasyGridComposite re-exposes by delegating to the wrapped grid instance. Used as the type argument for Lombok @Delegate on the EasyGridComposite.IEasyGridDelegate inner class.
  • Method Details

    • addDataGenerator

      Registration addDataGenerator(DataGenerator<T> generator)
      Adds the given data generator. If the generator was already added, does nothing.
      Parameters:
      generator - the data generator to add
      Returns:
      a registration that can be used to remove the data generator
    • addItemClickListener

      Registration addItemClickListener(ComponentEventListener<ItemClickEvent<T>> listener)
      Adds an item click listener to this component.
      Parameters:
      listener - the listener to add, not null
      Returns:
      a handle that can be used for removing the listener
    • addSelectionListener

      Registration addSelectionListener(SelectionListener<Grid<T>,T> listener)
      Adds a selection listener to the current selection model.

      This is a shorthand for grid.getSelectionModel().addSelectionListener(). To get more detailed selection events, use getSelectionModel() and either GridSingleSelectionModel#addSingleSelectionListener(SingleSelectionListener) or GridMultiSelectionModel#addMultiSelectionListener(MultiSelectionListener) depending on the used selection mode.

      Parameters:
      listener - the listener to add
      Returns:
      a registration handle to remove the listener
      Throws:
      UnsupportedOperationException - if selection has been disabled with Grid.SelectionMode.NONE
    • addComponentColumn

      <V extends Component> Grid.Column<T> addComponentColumn(ValueProvider<T,V> componentProvider)
      Adds a new column that shows components.

      This is a shorthand for addColumn(Renderer) with a ComponentRenderer.

      NOTE: Using ComponentRenderer is not as efficient as the built in renderers or using LitRenderer.

      Every added column sends data to the client side regardless of its visibility state. Don't add a new column at all or use Grid#removeColumn(Column) to avoid sending extra data.

      Type Parameters:
      V - the component type
      Parameters:
      componentProvider - a value provider that will return a component for the given item
      Returns:
      the new column
    • getGenericDataView

      GridDataView<T> getGenericDataView()
      Gets the generic data view for the grid. This data view should only be used when getListDataView() or getLazyDataView() is not applicable for the underlying data provider.
      Returns:
      the generic DataView implementation for grid
      See Also:
    • getLazyDataView

      GridLazyDataView<T> getLazyDataView()
      Gets the lazy data view for the grid. This data view should only be used when the items are provided lazily from the backend with:
      • setItems(CallbackDataProvider.FetchCallback)
      • setItems(CallbackDataProvider.FetchCallback, CallbackDataProvider.CountCallback)
      • setItems(BackEndDataProvider)
      If the items are not fetched lazily an exception is thrown. When the items are in-memory, use getListDataView() instead.
      Returns:
      the lazy data view that provides access to the data bound to the grid
    • getListDataView

      GridListDataView<T> getListDataView()
      Gets the list data view for the grid. This data view should only be used when the items are in-memory set with: If the items are not in-memory an exception is thrown. When the items are fetched lazily, use getLazyDataView() instead.
      Returns:
      the list data view that provides access to the items in the grid
    • getSelectedItems

      Set<T> getSelectedItems()
      This method is a shorthand that delegates to the currently set selection model.
      Returns:
      a set with the selected items, never null
      See Also:
    • setItems

      GridLazyDataView<T> setItems(BackEndDataProvider<T,Void> dataProvider)
      Supply items with a BackEndDataProvider that lazy loads items from a backend. Note that component will query the data provider for the item count. In case that is not desired for performance reasons, use setItems(CallbackDataProvider.FetchCallback) instead.

      The returned data view object can be used for further configuration, or later on fetched with getLazyDataView(). For using in-memory data, like Collection, use HasListDataView#setItems(Collection) instead.

      Parameters:
      dataProvider - BackEndDataProvider instance
      Returns:
      LazyDataView instance for further configuration
    • setItems

      GridDataView<T> setItems(DataProvider<T,Void> dataProvider)
      Set a generic data provider for the component to use and returns the base DataView that provides API to get information on the items.

      This method should be used only when the data provider type is not either ListDataProvider or BackEndDataProvider.

      Parameters:
      dataProvider - DataProvider instance to use, not null
      Returns:
      DataView providing information on the data
    • setItems

      GridListDataView<T> setItems(ListDataProvider<T> dataProvider)
      Sets a ListDataProvider for the component to use and returns a ListDataView that provides information and allows operations on the items.
      Parameters:
      dataProvider - ListDataProvider providing items to the component
      Returns:
      ListDataView providing access to the items
    • setItems

      GridDataView<T> setItems(InMemoryDataProvider<T> dataProvider)
      Sets an in-memory data provider for the component to use.

      Note! Using a ListDataProvider instead of an InMemoryDataProvider is recommended to get access to ListDataView API by using setItems(ListDataProvider).

      Parameters:
      dataProvider - InMemoryDataProvider to use, not null
      Returns:
      DataView providing information on the data
    • setSelectionMode

      GridSelectionModel<T> setSelectionMode(Grid.SelectionMode selectionMode)
      Sets the grid's selection mode.

      To use your custom selection model, you can use setSelectionModel(GridSelectionModel, SelectionMode), see existing selection model implementations for example.

      Parameters:
      selectionMode - the selection mode to switch to, not null
      Returns:
      the used selection model
      See Also:
    • setSortableColumns

      void setSortableColumns(String... propertyNames)
      Sets the defined columns as sortable, based on the given property names.

      This is a shortcut for setting all columns not sortable and then calling Column#setSortable(boolean) for each of the columns defined by the given propertyNames.

      You can set sortable columns for nested properties with dot notation, eg. "property.nestedProperty"

      Note: This method can only be used for a Grid created from a bean type with Grid(Class).

      Parameters:
      propertyNames - the property names used to reference the columns
      Throws:
      IllegalArgumentException - if any of the propertyNames refers to a non-existing column