public class SelectionModelMulti<T> extends AbstractRowHandleSelectionModel<T> implements SelectionModel.Multi.Batched<T>
SelectionModel.Multi.Batched<T>SelectionModel.Multi<T>, SelectionModel.None<T>, SelectionModel.Single<T>| Constructor and Description |
|---|
SelectionModelMulti() |
| Modifier and Type | Method and Description |
|---|---|
void |
commitBatchSelect()
Commits and ends a batch selection.
|
boolean |
deselect(Collection<T> rows)
Deselect all rows in a
Collection. |
boolean |
deselect(T... rows)
Deselects one or more rows.
|
boolean |
deselectAll()
De-selects all rows.
|
protected boolean |
deselectByHandle(DataSource.RowHandle<T> handle)
Deselect a row, based on its
RowHandle. |
Collection<T> |
getDeselectedRowsBatch()
Gets all the rows that would become deselected in this batch.
|
Collection<T> |
getSelectedRows()
Returns a Collection containing all selected rows.
|
Collection<T> |
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.
|
boolean |
isSelected(T row)
Return true if the provided row is considered selected under the
implementing selection model.
|
protected boolean |
isSelectedByHandle(DataSource.RowHandle<T> handle) |
void |
reset()
Resets the SelectionModel to the initial state.
|
boolean |
select(Collection<T> rows)
Select all rows in a
Collection. |
boolean |
select(T... rows)
Selects one or more rows.
|
protected boolean |
selectByHandle(DataSource.RowHandle<T> handle)
Select a row, based on its
RowHandle. |
void |
setGrid(Grid<T> grid)
Tells this SelectionModel which Grid it belongs to.
|
void |
startBatchSelect()
Starts a batch selection.
|
public boolean isSelected(T row)
SelectionModelisSelected in interface SelectionModel<T>row - row object instancetrue, if the row given as argument is considered
selected.public Renderer<Boolean> getSelectionColumnRenderer()
SelectionModelRenderer responsible for rendering the selection
column.getSelectionColumnRenderer in interface SelectionModel<T>public void setGrid(Grid<T> grid)
SelectionModelImplementations are free to have this be a no-op. This method is called internally by Grid.
setGrid in interface SelectionModel<T>grid - a Grid instance; null when removing from
Gridpublic boolean select(T... rows)
SelectionModel.Multiselect in interface SelectionModel.Multi<T>rows - Grid row objectspublic boolean deselect(T... rows)
SelectionModel.Multideselect in interface SelectionModel.Multi<T>rows - Grid row objectspublic boolean deselectAll()
SelectionModel.MultideselectAll in interface SelectionModel.Multi<T>public boolean select(Collection<T> rows)
SelectionModel.MultiCollection.select in interface SelectionModel.Multi<T>rows - a collection of Grid row objectspublic boolean deselect(Collection<T> rows)
SelectionModel.MultiCollection.deselect in interface SelectionModel.Multi<T>rows - a collection of Grid row objectsprotected boolean isSelectedByHandle(DataSource.RowHandle<T> handle)
protected boolean selectByHandle(DataSource.RowHandle<T> handle)
AbstractRowHandleSelectionModelRowHandle.
Note: this method may not fire selection change events.
selectByHandle in class AbstractRowHandleSelectionModel<T>handle - the handle to select bytrue iff the selection state was changed by this
callprotected boolean deselectByHandle(DataSource.RowHandle<T> handle)
AbstractRowHandleSelectionModelRowHandle.
Note: this method may not fire selection change events.
deselectByHandle in class AbstractRowHandleSelectionModel<T>handle - the handle to deselect bytrue iff the selection state was changed by this
callpublic Collection<T> getSelectedRows()
SelectionModelgetSelectedRows in interface SelectionModel<T>public void reset()
SelectionModelThis method can be called internally, for example, when the attached Grid's data source changes.
reset in interface SelectionModel<T>public 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<T>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<T>public boolean isBeingBatchSelected()
SelectionModel.Multi.BatchedisBeingBatchSelected in interface SelectionModel.Multi.Batched<T>true iff a batch has been startedpublic Collection<T> getSelectedRowsBatch()
SelectionModel.Multi.BatchedgetSelectedRowsBatch in interface SelectionModel.Multi.Batched<T>public Collection<T> getDeselectedRowsBatch()
SelectionModel.Multi.BatchedgetDeselectedRowsBatch in interface SelectionModel.Multi.Batched<T>Copyright © 2016 Vaadin Ltd. All rights reserved.