Class SelectionModelSingle<T>

    • Constructor Detail

      • SelectionModelSingle

        public SelectionModelSingle()
    • Method Detail

      • isSelected

        public boolean isSelected​(T row)
        Description copied from interface: SelectionModel
        Return true if the provided row is considered selected under the implementing selection model.
        Specified by:
        isSelected in interface SelectionModel<T>
        Parameters:
        row - row object instance
        Returns:
        true, if the row given as argument is considered selected.
      • setGrid

        public void setGrid​(Grid<T> grid)
        Description copied from interface: SelectionModel
        Tells this SelectionModel which Grid it belongs to.

        Implementations are free to have this be a no-op. This method is called internally by Grid.

        Specified by:
        setGrid in interface SelectionModel<T>
        Parameters:
        grid - a Grid instance; null when removing from Grid
      • deselect

        public boolean deselect​(T row)
        Description copied from interface: SelectionModel.Single
        Deselects a row.

        This is a no-op unless row is the currently selected row.

        Specified by:
        deselect in interface SelectionModel.Single<T>
        Parameters:
        row - a Grid row object
        Returns:
        true, if the currently selected row was deselected.
      • reset

        public void reset()
        Description copied from interface: SelectionModel
        Resets the SelectionModel to the initial state.

        This method can be called internally, for example, when the attached Grid's data source changes.

        Specified by:
        reset in interface SelectionModel<T>
      • setDeselectAllowed

        public void setDeselectAllowed​(boolean deselectAllowed)
        Description copied from interface: SelectionModel.Single
        Sets whether it's allowed to deselect the selected row through the UI. Deselection is allowed by default.
        Specified by:
        setDeselectAllowed in interface SelectionModel.Single<T>
        Parameters:
        deselectAllowed - true if the selected row can be deselected without selecting another row instead; otherwise false.
      • isDeselectAllowed

        public boolean isDeselectAllowed()
        Description copied from interface: SelectionModel.Single
        Sets whether it's allowed to deselect the selected row through the UI.
        Specified by:
        isDeselectAllowed in interface SelectionModel.Single<T>
        Returns:
        true if deselection is allowed; otherwise false
      • setUserSelectionAllowed

        public void setUserSelectionAllowed​(boolean userSelectionAllowed)
        Description copied from interface: HasUserSelectionAllowed
        Sets whether the user is allowed to change the selection.
        Specified by:
        setUserSelectionAllowed in interface HasUserSelectionAllowed<T>
        Parameters:
        userSelectionAllowed - true if the user is allowed to change the selection, false otherwise