Class MultiSelectionModelConnector.MultiSelectionModel

    • Constructor Detail

      • MultiSelectionModel

        protected MultiSelectionModel()
    • Method Detail

      • createSelectionColumnRenderer

        protected ComplexRenderer<Boolean> createSelectionColumnRenderer​(Grid<elemental.json.JsonObject> grid)
        Creates a selection column renderer. This method can be overridden to use a custom renderer or use null to disable the selection column.
        Parameters:
        grid - the grid for this selection model
        Returns:
        selection column renderer or null if not needed
      • selectAll

        public void selectAll()
        Selects all available rows, sends request to server to select everything.
      • getSelectionColumnRenderer

        public Renderer<Boolean> getSelectionColumnRenderer()
        Description copied from interface: SelectionModel
        Return the Renderer responsible for rendering the selection column.
        Specified by:
        getSelectionColumnRenderer in interface SelectionModel<elemental.json.JsonObject>
        Returns:
        a renderer instance. If null is returned, a selection column will not be drawn.
      • select

        public boolean select​(elemental.json.JsonObject... rows)
        Selects one or more rows.
        Specified by:
        select in interface SelectionModel.Multi<elemental.json.JsonObject>
        Parameters:
        rows - Grid row objects
        Returns:
        false if rows is empty, else true
      • deselect

        public boolean deselect​(elemental.json.JsonObject... rows)
        Deselects one or more rows.
        Specified by:
        deselect in interface SelectionModel.Multi<elemental.json.JsonObject>
        Parameters:
        rows - Grid row objects
        Returns:
        false if rows is empty, else true
      • deselectAll

        public boolean deselectAll()
        De-selects all rows.
        Specified by:
        deselectAll in interface SelectionModel.Multi<elemental.json.JsonObject>
        Returns:
        always true
      • select

        public boolean select​(Collection<elemental.json.JsonObject> rows)
        Select all rows in a Collection.
        Specified by:
        select in interface SelectionModel.Multi<elemental.json.JsonObject>
        Parameters:
        rows - a collection of Grid row objects
        Returns:
        false if rows is empty, else true
      • markAsSelected

        protected boolean markAsSelected​(DataSource.RowHandle<elemental.json.JsonObject> row,
                                         boolean selected)
        Marks the given row to be selected or deselected. Returns true if the value actually changed.

        Note: If selection model is in batch select state, the row will be pinned on select.

        Parameters:
        row - row handle
        selected - true if row should be selected; false if not
        Returns:
        true if selected status changed; false if not
      • deselect

        public boolean deselect​(Collection<elemental.json.JsonObject> rows)
        Deselect all rows in a Collection.
        Specified by:
        deselect in interface SelectionModel.Multi<elemental.json.JsonObject>
        Parameters:
        rows - a collection of Grid row objects
        Returns:
        false if rows is empty, else true
      • isUserSelectionAllowed

        public boolean isUserSelectionAllowed()
        Description copied from interface: HasUserSelectionAllowed
        Checks if the user is allowed to change the selection.
        Specified by:
        isUserSelectionAllowed in interface HasUserSelectionAllowed<elemental.json.JsonObject>
        Returns:
        true if the user is allowed to change the selection, false otherwise
      • 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<elemental.json.JsonObject>
        Parameters:
        userSelectionAllowed - true if the user is allowed to change the selection, false otherwise