Class AbstractGridSingleSelectionModel<T>

java.lang.Object
io.jmix.groupgridflowui.kit.vaadin.grid.Grid.AbstractGridExtension<T>
io.jmix.groupgridflowui.kit.vaadin.grid.AbstractGridSingleSelectionModel<T>
Type Parameters:
T - the grid type
All Implemented Interfaces:
com.vaadin.flow.data.provider.DataGenerator<T>, com.vaadin.flow.data.selection.SelectionModel<Grid<T>,T>, com.vaadin.flow.data.selection.SelectionModel.Single<Grid<T>,T>, GridSelectionModel<T>, GridSingleSelectionModel<T>, Serializable

public abstract class AbstractGridSingleSelectionModel<T> extends Grid.AbstractGridExtension<T> implements GridSingleSelectionModel<T>
Abstract implementation of a GridSingleSelectionModel.
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 extends Object>, com.vaadin.flow.data.selection.SelectionModel.Single<C extends com.vaadin.flow.component.Component,T extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
    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<Grid<T>,T> listener)
     
    com.vaadin.flow.shared.Registration
    addSingleSelectionListener(com.vaadin.flow.data.selection.SingleSelectionListener<Grid<T>,T> listener)
    Adds a selection listener that will be called when the selection is changed either by the user or programmatically.
    com.vaadin.flow.data.selection.SingleSelect<Grid<T>,T>
    Gets a wrapper to use this single selection model as a single select in Binder.
    void
    deselect(T item)
     
    void
    Handles the deselection of an item that originates from the client.
    protected abstract void
    fireSelectionEvent(com.vaadin.flow.data.selection.SelectionEvent<Grid<T>,T> event)
    Method for handling the firing of selection events.
    void
    generateData(T item, elemental.json.JsonObject jsonObject)
     
     
    boolean
     
    boolean
    isSelected(T item)
     
    protected void
    Remove this extension from its target.
    void
    select(T item)
     
    void
    Handles the selection of an item that originates from the client.
    void
    setDeselectAllowed(boolean deselectAllowed)
     

    Methods inherited from class io.jmix.groupgridflowui.kit.vaadin.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.Single

    deselectAll, getFirstSelectedItem, getSelectedItems, setSelectedItem
  • Constructor Details

    • AbstractGridSingleSelectionModel

      public AbstractGridSingleSelectionModel(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)
      Description copied from interface: GridSelectionModel
      Handles the selection of an item that originates from the client.
      Specified by:
      selectFromClient in interface GridSelectionModel<T>
      Parameters:
      item - the item being selected
    • select

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

      public void deselectFromClient(T item)
      Description copied from interface: GridSelectionModel
      Handles the deselection of an item that originates from the client.
      Specified by:
      deselectFromClient in interface GridSelectionModel<T>
      Parameters:
      item - the item being deselected
    • deselect

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

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

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

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

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

      public com.vaadin.flow.data.selection.SingleSelect<Grid<T>,T> asSingleSelect()
      Description copied from interface: GridSingleSelectionModel
      Gets a wrapper to use this single selection model as a single select in Binder.
      Specified by:
      asSingleSelect in interface GridSingleSelectionModel<T>
      Returns:
      the single select wrapper
    • addSelectionListener

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

      public com.vaadin.flow.shared.Registration addSingleSelectionListener(com.vaadin.flow.data.selection.SingleSelectionListener<Grid<T>,T> listener)
      Description copied from interface: GridSingleSelectionModel
      Adds a selection listener that will be called when the selection is changed either by the user or programmatically.
      Specified by:
      addSingleSelectionListener in interface GridSingleSelectionModel<T>
      Parameters:
      listener - the single selection listener, not null
      Returns:
      a registration for the listener
    • generateData

      public void generateData(T item, elemental.json.JsonObject jsonObject)
      Specified by:
      generateData in interface com.vaadin.flow.data.provider.DataGenerator<T>
    • remove

      protected void remove()
      Description copied from class: Grid.AbstractGridExtension
      Remove this extension from its target.
      Overrides:
      remove in class Grid.AbstractGridExtension<T>
    • fireSelectionEvent

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