Class AbstractGridSingleSelectionModel<T>

    • 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 Detail

      • 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 Detail

      • 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>
      • 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