Class CustomAbstractGridMultiSelectionModel<T>

java.lang.Object
com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T>
com.vaadin.flow.component.grid.CustomAbstractGridMultiSelectionModel<T>
Type Parameters:
T - the type of the grid items
All Implemented Interfaces:
com.vaadin.flow.component.grid.GridMultiSelectionModel<T>, com.vaadin.flow.component.grid.GridSelectionModel<T>, com.vaadin.flow.data.provider.DataGenerator<T>, com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<T>,T>, com.vaadin.flow.data.selection.SelectionModel.Multi<com.vaadin.flow.component.grid.Grid<T>,T>, Serializable

public abstract class CustomAbstractGridMultiSelectionModel<T> extends com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T> implements com.vaadin.flow.component.grid.GridMultiSelectionModel<T>
Abstract implementation of a multi selection model for a grid.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.grid.GridMultiSelectionModel

    com.vaadin.flow.component.grid.GridMultiSelectionModel.SelectAllCheckboxVisibility

    Nested classes/interfaces inherited from interface com.vaadin.flow.data.selection.SelectionModel

    com.vaadin.flow.data.selection.SelectionModel.Multi<C extends com.vaadin.flow.component.Component,T>, com.vaadin.flow.data.selection.SelectionModel.Single<C extends com.vaadin.flow.component.Component,T>
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomAbstractGridMultiSelectionModel(com.vaadin.flow.component.grid.Grid<T> grid)
    Constructor for passing a reference of the grid to this implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.shared.Registration
    addMultiSelectionListener(com.vaadin.flow.data.selection.MultiSelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
     
    com.vaadin.flow.shared.Registration
    addSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
     
    com.vaadin.flow.data.selection.MultiSelect<com.vaadin.flow.component.grid.Grid<T>,T>
     
    void
    deselect(T item)
     
    void
     
    void
     
    protected abstract void
    fireSelectionEvent(com.vaadin.flow.data.selection.SelectionEvent<com.vaadin.flow.component.grid.Grid<T>,T> event)
    Method for handling the firing of selection events.
    void
    generateData(T item, tools.jackson.databind.node.ObjectNode jsonObject)
     
     
    com.vaadin.flow.component.grid.GridMultiSelectionModel.SelectAllCheckboxVisibility
     
     
    boolean
     
    boolean
    isSelected(T item)
     
    boolean
     
    protected void
     
    void
    select(T item)
     
    void
     
    void
     
    void
    setSelectAllCheckboxVisibility(com.vaadin.flow.component.grid.GridMultiSelectionModel.SelectAllCheckboxVisibility selectAllCheckBoxVisibility)
     
    void
    setSelectionColumnFrozen(boolean frozen)
     
    void
    updateSelection(Set<T> addedItems, Set<T> removedItems)
     

    Methods inherited from class com.vaadin.flow.component.grid.Grid.AbstractGridExtension

    extend, getGrid, refresh

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.data.provider.DataGenerator

    destroyAllData, destroyData, refreshData

    Methods inherited from interface com.vaadin.flow.component.grid.GridMultiSelectionModel

    addClientItemToggleListener, isDragSelect, setDragSelect

    Methods inherited from interface com.vaadin.flow.data.selection.SelectionModel.Multi

    deselectItems, selectItems
  • Constructor Details

    • CustomAbstractGridMultiSelectionModel

      public CustomAbstractGridMultiSelectionModel(com.vaadin.flow.component.grid.Grid<T> grid)
      Constructor for passing a reference of the grid to this implementation.
      Parameters:
      grid - reference to the grid for which this selection model is created
  • Method Details

    • remove

      protected void remove()
      Overrides:
      remove in class com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T>
    • selectFromClient

      public void selectFromClient(T item)
      Specified by:
      selectFromClient in interface com.vaadin.flow.component.grid.GridSelectionModel<T>
    • deselectFromClient

      public void deselectFromClient(T item)
      Specified by:
      deselectFromClient in interface com.vaadin.flow.component.grid.GridSelectionModel<T>
    • getSelectedItems

      public Set<T> getSelectedItems()
      Specified by:
      getSelectedItems in interface com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<T>,T>
    • getFirstSelectedItem

      public Optional<T> getFirstSelectedItem()
      Specified by:
      getFirstSelectedItem in interface com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<T>,T>
      Specified by:
      getFirstSelectedItem in interface com.vaadin.flow.data.selection.SelectionModel.Multi<com.vaadin.flow.component.grid.Grid<T>,T>
    • select

      public void select(T item)
      Specified by:
      select in interface com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<T>,T>
      Specified by:
      select in interface com.vaadin.flow.data.selection.SelectionModel.Multi<com.vaadin.flow.component.grid.Grid<T>,T>
    • deselect

      public void deselect(T item)
      Specified by:
      deselect in interface com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<T>,T>
      Specified by:
      deselect in interface com.vaadin.flow.data.selection.SelectionModel.Multi<com.vaadin.flow.component.grid.Grid<T>,T>
    • selectAll

      public void selectAll()
      Specified by:
      selectAll in interface com.vaadin.flow.data.selection.SelectionModel.Multi<com.vaadin.flow.component.grid.Grid<T>,T>
    • deselectAll

      public void deselectAll()
      Specified by:
      deselectAll in interface com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<T>,T>
    • updateSelection

      public void updateSelection(Set<T> addedItems, Set<T> removedItems)
      Specified by:
      updateSelection in interface com.vaadin.flow.data.selection.SelectionModel.Multi<com.vaadin.flow.component.grid.Grid<T>,T>
    • isSelected

      public boolean isSelected(T item)
      Specified by:
      isSelected in interface com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<T>,T>
    • asMultiSelect

      public com.vaadin.flow.data.selection.MultiSelect<com.vaadin.flow.component.grid.Grid<T>,T> asMultiSelect()
      Specified by:
      asMultiSelect in interface com.vaadin.flow.component.grid.GridMultiSelectionModel<T>
    • addSelectionListener

      public com.vaadin.flow.shared.Registration addSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
      Specified by:
      addSelectionListener in interface com.vaadin.flow.data.selection.SelectionModel<com.vaadin.flow.component.grid.Grid<T>,T>
    • addMultiSelectionListener

      public com.vaadin.flow.shared.Registration addMultiSelectionListener(com.vaadin.flow.data.selection.MultiSelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
      Specified by:
      addMultiSelectionListener in interface com.vaadin.flow.component.grid.GridMultiSelectionModel<T>
    • setSelectAllCheckboxVisibility

      public void setSelectAllCheckboxVisibility(com.vaadin.flow.component.grid.GridMultiSelectionModel.SelectAllCheckboxVisibility selectAllCheckBoxVisibility)
      Specified by:
      setSelectAllCheckboxVisibility in interface com.vaadin.flow.component.grid.GridMultiSelectionModel<T>
    • getSelectAllCheckboxVisibility

      public com.vaadin.flow.component.grid.GridMultiSelectionModel.SelectAllCheckboxVisibility getSelectAllCheckboxVisibility()
      Specified by:
      getSelectAllCheckboxVisibility in interface com.vaadin.flow.component.grid.GridMultiSelectionModel<T>
    • isSelectAllCheckboxVisible

      public boolean isSelectAllCheckboxVisible()
      Specified by:
      isSelectAllCheckboxVisible in interface com.vaadin.flow.component.grid.GridMultiSelectionModel<T>
    • generateData

      public void generateData(T item, tools.jackson.databind.node.ObjectNode jsonObject)
      Specified by:
      generateData in interface com.vaadin.flow.data.provider.DataGenerator<T>
    • setSelectionColumnFrozen

      public void setSelectionColumnFrozen(boolean frozen)
      Specified by:
      setSelectionColumnFrozen in interface com.vaadin.flow.component.grid.GridMultiSelectionModel<T>
    • isSelectionColumnFrozen

      public boolean isSelectionColumnFrozen()
      Specified by:
      isSelectionColumnFrozen in interface com.vaadin.flow.component.grid.GridMultiSelectionModel<T>
    • fireSelectionEvent

      protected abstract void fireSelectionEvent(com.vaadin.flow.data.selection.SelectionEvent<com.vaadin.flow.component.grid.Grid<T>,T> event)
      Method for handling the firing of selection events.
      Parameters:
      event - the selection event to fire