Package com.vaadin.ui

Interface Grid.SelectionModel.Single

    • Method Detail

      • select

        boolean select​(Object itemId)
                throws IllegalStateException,
                       IllegalArgumentException
        Marks an item as selected.
        Parameters:
        itemId - the itemId to mark as selected; null for deselect
        Returns:
        true if the selection state changed. false if the itemId already was selected
        Throws:
        IllegalStateException - if the selection was illegal. One such reason might be that the given id was null, indicating a deselect, but implementation doesn't allow deselecting. re-selecting something
        IllegalArgumentException - if given itemId does not exist in the container of Grid
      • getSelectedRow

        Object getSelectedRow()
        Gets the item id of the currently selected item.
        Returns:
        the item id of the currently selected item, or null if nothing is selected
      • setDeselectAllowed

        void setDeselectAllowed​(boolean deselectAllowed)
        Sets whether it's allowed to deselect the selected row through the UI. Deselection is allowed by default.
        Parameters:
        deselectAllowed - true if the selected row can be deselected without selecting another row instead; otherwise false.
      • isDeselectAllowed

        boolean isDeselectAllowed()
        Sets whether it's allowed to deselect the selected row through the UI.
        Returns:
        true if deselection is allowed; otherwise false