com.vaadin.ui.components.grid.

Class NoSelectionModel<T>

    • Constructor Detail

      • NoSelectionModel

        public NoSelectionModel()
    • Method Detail

      • getSelectedItems

        public Set<T> getSelectedItems()

        Description copied from interface: SelectionModel

        Returns an immutable set of the currently selected items. It is safe to invoke other SelectionModel methods while iterating over the set.

        Implementation note: the iteration order of the items in the returned set should be well-defined and documented by the implementing class.

        Specified by:

        getSelectedItems in interface SelectionModel<T>

        Returns:

        the items in the current selection, not null

      • select

        public void select​(T item)

        Description copied from interface: SelectionModel

        Selects the given item. Depending on the implementation, may cause other items to be deselected. If the item is already selected, does nothing.

        Specified by:

        select in interface SelectionModel<T>

        Parameters:

        item - the item to select, not null

      • deselect

        public void deselect​(T item)

        Description copied from interface: SelectionModel

        Deselects the given item. If the item is not currently selected, does nothing.

        Specified by:

        deselect in interface SelectionModel<T>

        Parameters:

        item - the item to deselect, not null

      • addSelectionListener

        public Registration addSelectionListener​(SelectionListener<T> listener)

        Description copied from interface: SelectionModel

        Adds a generic listener to this selection model, accepting both single and multiselection events.

        Specified by:

        addSelectionListener in interface SelectionModel<T>

        Parameters:

        listener - the listener to add

        Returns:

        a registration handle for removing the listener

      • setUserSelectionAllowed

        public void setUserSelectionAllowed​(boolean allowed)

        Description copied from interface: GridSelectionModel

        Sets whether the user is allowed to change the selection.

        The check is done only for the client side actions. It doesn't affect selection requests sent from the server side.

        Specified by:

        setUserSelectionAllowed in interface GridSelectionModel<T>

        Parameters:

        allowed - true if the user is allowed to change the selection, false otherwise

      • isUserSelectionAllowed

        public boolean isUserSelectionAllowed()

        Description copied from interface: GridSelectionModel

        Checks if the user is allowed to change the selection.

        The check is done only for the client side actions. It doesn't affect selection requests sent from the server side.

        Specified by:

        isUserSelectionAllowed in interface GridSelectionModel<T>

        Returns:

        true if the user is allowed to change the selection, false otherwise