Class CustomAbstractGridSingleSelectionModel<T>

java.lang.Object
com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T>
com.vaadin.flow.component.grid.CustomAbstractGridSingleSelectionModel<T>
Type Parameters:
T - the grid type
All Implemented Interfaces:
com.vaadin.flow.component.grid.GridSelectionModel<T>, com.vaadin.flow.component.grid.GridSingleSelectionModel<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.Single<com.vaadin.flow.component.grid.Grid<T>,T>, Serializable

public abstract class CustomAbstractGridSingleSelectionModel<T> extends com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T> implements com.vaadin.flow.component.grid.GridSingleSelectionModel<T>
Abstract implementation of a GridSingleSelectionModel.
Author:
Vaadin Ltd.
See Also:
  • Nested Class Summary

    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
    CustomAbstractGridSingleSelectionModel(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
    addSelectionListener(com.vaadin.flow.data.selection.SelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
     
    com.vaadin.flow.shared.Registration
    addSingleSelectionListener(com.vaadin.flow.data.selection.SingleSelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
     
    com.vaadin.flow.data.selection.SingleSelect<com.vaadin.flow.component.grid.Grid<T>,T>
     
    void
    deselect(T item)
     
    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)
     
     
    boolean
     
    protected void
     
    void
    select(T item)
     
    void
     
    void
    setDeselectAllowed(boolean deselectAllowed)
     

    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.data.selection.SelectionModel

    isSelected

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

    deselectAll, getFirstSelectedItem, getSelectedItems, setSelectedItem
  • Constructor Details

    • CustomAbstractGridSingleSelectionModel

      public CustomAbstractGridSingleSelectionModel(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

    • selectFromClient

      public void selectFromClient(T item)
      Specified by:
      selectFromClient in interface com.vaadin.flow.component.grid.GridSelectionModel<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.Single<com.vaadin.flow.component.grid.Grid<T>,T>
    • deselectFromClient

      public void deselectFromClient(T item)
      Specified by:
      deselectFromClient in interface com.vaadin.flow.component.grid.GridSelectionModel<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>
    • getSelectedItem

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

      public void setDeselectAllowed(boolean deselectAllowed)
      Specified by:
      setDeselectAllowed in interface com.vaadin.flow.data.selection.SelectionModel.Single<com.vaadin.flow.component.grid.Grid<T>,T>
    • isDeselectAllowed

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

      public com.vaadin.flow.data.selection.SingleSelect<com.vaadin.flow.component.grid.Grid<T>,T> asSingleSelect()
      Specified by:
      asSingleSelect in interface com.vaadin.flow.component.grid.GridSingleSelectionModel<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>
    • addSingleSelectionListener

      public com.vaadin.flow.shared.Registration addSingleSelectionListener(com.vaadin.flow.data.selection.SingleSelectionListener<com.vaadin.flow.component.grid.Grid<T>,T> listener)
      Specified by:
      addSingleSelectionListener in interface com.vaadin.flow.component.grid.GridSingleSelectionModel<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>
    • remove

      protected void remove()
      Overrides:
      remove in class com.vaadin.flow.component.grid.Grid.AbstractGridExtension<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