protected class MultiSelectionModelConnector.MultiSelectionModel extends AbstractSelectionModelConnector.AbstractSelectionModel implements SelectionModel.Multi.Batched<elemental.json.JsonObject>
SelectionModel.Multi.Batched<T>SelectionModel.Multi<T>, SelectionModel.None<T>, SelectionModel.Single<T>| Modifier | Constructor and Description |
|---|---|
protected |
MultiSelectionModel() |
| Modifier and Type | Method and Description |
|---|---|
void |
commitBatchSelect()
Commits and ends a batch selection.
|
protected ComplexRenderer<Boolean> |
createSelectionColumnRenderer(Grid<elemental.json.JsonObject> grid)
Creates a selection column renderer.
|
boolean |
deselect(Collection<elemental.json.JsonObject> rows)
Deselect all rows in a
Collection. |
boolean |
deselect(elemental.json.JsonObject... rows)
Deselects one or more rows.
|
boolean |
deselectAll()
De-selects all rows.
|
Collection<elemental.json.JsonObject> |
getDeselectedRowsBatch()
Gets all the rows that would become deselected in this batch.
|
Collection<elemental.json.JsonObject> |
getSelectedRowsBatch()
Gets all the rows that would become selected in this batch.
|
Renderer<Boolean> |
getSelectionColumnRenderer()
Return the
Renderer responsible for rendering the selection
column. |
boolean |
isBeingBatchSelected()
Checks whether or not a batch has been started.
|
protected boolean |
markAsSelected(DataSource.RowHandle<elemental.json.JsonObject> row,
boolean selected)
Marks the given row to be selected or deselected.
|
boolean |
select(Collection<elemental.json.JsonObject> rows)
Select all rows in a
Collection. |
boolean |
select(elemental.json.JsonObject... rows)
Selects one or more rows.
|
void |
selectAll()
Selects all available rows, sends request to server to select
everything.
|
void |
setGrid(Grid<elemental.json.JsonObject> grid)
Tells this SelectionModel which Grid it belongs to.
|
void |
startBatchSelect()
Starts a batch selection.
|
getSelectedRows, isSelected, resetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSelectedRows, isSelected, resetpublic void setGrid(Grid<elemental.json.JsonObject> grid)
SelectionModelImplementations are free to have this be a no-op. This method is called internally by Grid.
setGrid in interface SelectionModel<elemental.json.JsonObject>setGrid in class AbstractSelectionModelConnector.AbstractSelectionModelgrid - a Grid instance; null when removing from
Gridprotected ComplexRenderer<Boolean> createSelectionColumnRenderer(Grid<elemental.json.JsonObject> grid)
null to disable the selection
column.grid - the grid for this selection modelnull if not neededpublic void selectAll()
public Renderer<Boolean> getSelectionColumnRenderer()
SelectionModelRenderer responsible for rendering the selection
column.getSelectionColumnRenderer in interface SelectionModel<elemental.json.JsonObject>public boolean select(elemental.json.JsonObject... rows)
select in interface SelectionModel.Multi<elemental.json.JsonObject>rows - Grid row objectsfalse if rows is empty, else truepublic boolean deselect(elemental.json.JsonObject... rows)
deselect in interface SelectionModel.Multi<elemental.json.JsonObject>rows - Grid row objectsfalse if rows is empty, else truepublic boolean deselectAll()
deselectAll in interface SelectionModel.Multi<elemental.json.JsonObject>truepublic boolean select(Collection<elemental.json.JsonObject> rows)
Collection.select in interface SelectionModel.Multi<elemental.json.JsonObject>rows - a collection of Grid row objectsfalse if rows is empty, else trueprotected boolean markAsSelected(DataSource.RowHandle<elemental.json.JsonObject> row, boolean selected)
Note: If selection model is in batch select state, the row will be pinned on select.
row - row handleselected - true if row should be selected; false if
nottrue if selected status changed; false if notpublic boolean deselect(Collection<elemental.json.JsonObject> rows)
Collection.deselect in interface SelectionModel.Multi<elemental.json.JsonObject>rows - a collection of Grid row objectsfalse if rows is empty, else truepublic void startBatchSelect()
SelectionModel.Multi.Batched
Any commands to any select or deselect method will be batched
into one, and a final selection event will be fired when
SelectionModel.Multi.Batched.commitBatchSelect() is called.
Note: SelectionChangeEvents will
still be fired for each selection/deselection. You should check
whether the event is a part of a batch or not with
SelectionEvent.isBatchedSelection().
startBatchSelect in interface SelectionModel.Multi.Batched<elemental.json.JsonObject>public void commitBatchSelect()
SelectionModel.Multi.Batched
Any and all selections and deselections since the last invocation
of SelectionModel.Multi.Batched.startBatchSelect() will be fired at once as one
collated SelectionEvent.
commitBatchSelect in interface SelectionModel.Multi.Batched<elemental.json.JsonObject>public boolean isBeingBatchSelected()
SelectionModel.Multi.BatchedisBeingBatchSelected in interface SelectionModel.Multi.Batched<elemental.json.JsonObject>true iff a batch has been startedpublic Collection<elemental.json.JsonObject> getSelectedRowsBatch()
SelectionModel.Multi.BatchedgetSelectedRowsBatch in interface SelectionModel.Multi.Batched<elemental.json.JsonObject>public Collection<elemental.json.JsonObject> getDeselectedRowsBatch()
SelectionModel.Multi.BatchedgetDeselectedRowsBatch in interface SelectionModel.Multi.Batched<elemental.json.JsonObject>Copyright © 2016 Vaadin Ltd. All rights reserved.