public class GridSelectionModel<M> extends AbstractStoreSelectionModel<M>
Modifier and Type | Class and Description |
---|---|
static class |
GridSelectionModel.SelectionModelCallback
Determines whether a given cell is selectable.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
deselectOnSimpleClick
True to deselect a selected item on click (defaults to true).
|
protected boolean |
enableNavKeys
True if this grid selection model supports keyboard navigation (defaults to true).
|
protected Grid<M> |
grid
The grid associated with this selection model.
|
protected GroupingHandlerRegistration |
handlerRegistration
A group of handler registrations for this selection model.
|
protected KeyNav |
keyNav
The current keyboard navigator.
|
protected ListStore<M> |
listStore
The list store for this selection model.
|
fireSelectionChangeOnClick, lastSelected, locked, mouseDown, selected, selectionMode, store
Constructor and Description |
---|
GridSelectionModel() |
Modifier and Type | Method and Description |
---|---|
void |
bind(Store<M> store)
Binds the store to the selection model.
|
void |
bindGrid(Grid<M> grid)
Binds the given grid to this selection model.
|
Grid<M> |
getGrid()
Returns the currently bound grid.
|
protected boolean |
hasNext()
Returns true if there is an item in the list store following the most recently selected item (i.e.
|
protected boolean |
hasPrevious()
Returns true if there is an item in the list store preceding the most recently selected item (i.e.
|
protected boolean |
isSelectable(int row,
int cell)
Returns true if the given cell is selectable.
|
protected void |
onKeyDown(NativeEvent ne)
Handles a key down event (e.g.
|
protected void |
onKeyLeft(NativeEvent e)
Handles a key left event (e.g.
|
protected void |
onKeyPress(NativeEvent ne)
Handles a key press event (e.g.
|
protected void |
onKeyRight(NativeEvent e)
Handles a key right event (e.g.
|
protected void |
onKeyUp(NativeEvent e)
Handles a key up event (e.g.
|
protected void |
onLastFocusChanged(M oldFocused,
M newFocused) |
protected void |
onRecordChange(StoreRecordChangeEvent<M> event) |
protected void |
onRowClick(RowClickEvent event)
Handles a row click event.
|
protected void |
onRowMouseDown(RowMouseDownEvent event)
Handles a row mouse down event.
|
protected void |
onSelectChange(M model,
boolean select) |
protected void |
onUpdate(M model) |
void |
selectNext(boolean keepexisting)
Selects the next row.
|
void |
selectPrevious(boolean keepexisting)
Selects the previous row.
|
addBeforeSelectionHandler, addSelectionChangedHandler, addSelectionHandler, deselect, deselect, deselect, deselect, deselect, deselectAll, doDeselect, doMultiSelect, doSelect, doSingleSelect, ensureHandlers, fireEvent, fireSelectionChange, getLastFocused, getSelectedItem, getSelectedItems, getSelection, getSelectionMode, isLocked, isSelected, onAdd, onClear, onRemove, refresh, select, select, select, select, select, selectAll, setLastFocused, setLocked, setSelection, setSelectionMode
protected boolean enableNavKeys
protected KeyNav keyNav
protected GroupingHandlerRegistration handlerRegistration
protected boolean deselectOnSimpleClick
public void bind(Store<M> store)
StoreSelectionModel
bind
in interface StoreSelectionModel<M>
bind
in class AbstractStoreSelectionModel<M>
store
- the bound storepublic void bindGrid(Grid<M> grid)
grid
- the grid to bind to this selection modelpublic void selectNext(boolean keepexisting)
keepexisting
- true to keep existing selectionspublic void selectPrevious(boolean keepexisting)
keepexisting
- true to keep existing selectionsprotected void onRowClick(RowClickEvent event)
event
- the row click eventprotected void onRowMouseDown(RowMouseDownEvent event)
event
- the row mouse down eventprotected boolean hasNext()
protected boolean hasPrevious()
protected boolean isSelectable(int row, int cell)
row
- the cell's rowcell
- the cell's columnprotected void onKeyDown(NativeEvent ne)
ne
- the key down eventprotected void onKeyLeft(NativeEvent e)
e
- the key left eventprotected void onKeyPress(NativeEvent ne)
ne
- the key press eventprotected void onKeyRight(NativeEvent e)
e
- the key right eventprotected void onKeyUp(NativeEvent e)
e
- the key up eventprotected void onLastFocusChanged(M oldFocused, M newFocused)
onLastFocusChanged
in class AbstractStoreSelectionModel<M>
protected void onRecordChange(StoreRecordChangeEvent<M> event)
onRecordChange
in class AbstractStoreSelectionModel<M>
protected void onSelectChange(M model, boolean select)
onSelectChange
in class AbstractStoreSelectionModel<M>
protected void onUpdate(M model)
onUpdate
in class AbstractStoreSelectionModel<M>
Copyright © 2018. All rights reserved.