com.extjs.gxt.ui.client.widget.grid
Class GridSelectionModel<M extends ModelData>

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.widget.selection.AbstractStoreSelectionModel<M>
          extended by com.extjs.gxt.ui.client.widget.grid.GridSelectionModel<M>
All Implemented Interfaces:
Listener<BaseEvent>, Observable, SelectionProvider<M>, StoreSelectionModel<M>, java.util.EventListener
Direct Known Subclasses:
CellSelectionModel, CheckBoxSelectionModel, TreeGridSelectionModel

public class GridSelectionModel<M extends ModelData>
extends AbstractStoreSelectionModel<M>
implements Listener<BaseEvent>

Grid selection model.

Inherited Events:
AbstractStoreSelectionModel BeforeSelect
AbstractStoreSelectionModel SelectionChange


Nested Class Summary
static class GridSelectionModel.Callback
           
static class GridSelectionModel.Cell
           
 
Field Summary
protected  boolean enableNavKeys
           
protected  Grid<M> grid
           
protected  boolean grouped
           
protected  GroupingView groupingView
           
protected  KeyNav<GridEvent<M>> keyNav
           
protected  ListStore<M> listStore
           
protected  com.google.gwt.user.client.Element selectedGroup
           
protected  ColumnHeader.Head selectedHeader
           
 
Fields inherited from class com.extjs.gxt.ui.client.widget.selection.AbstractStoreSelectionModel
lastSelected, locked, selected, selectionMode, store, storeListener
 
Constructor Summary
GridSelectionModel()
           
 
Method Summary
 void bind(Store store)
          Binds the store to the selection model.
 void bindGrid(Grid grid)
           
protected  void handleColumnHidden(ColumnModelEvent e)
           
 void handleEvent(BaseEvent e)
          Sent when an event that the listener has registered for occurs.
protected  void handleMouseClick(GridEvent<M> e)
           
protected  void handleMouseDown(GridEvent<M> e)
           
protected  boolean hasNext()
           
protected  boolean hasPrevious()
           
protected  boolean isInput(com.google.gwt.user.client.Element target)
           
 boolean isMoveEditorOnEnter()
          Returns true of the editor moves on enter.
protected  boolean isSelectable(int row, int cell, boolean acceptsNav)
           
 void onEditorKey(DomEvent e)
           
protected  void onKeyDown(GridEvent<M> e)
           
protected  void onKeyLeft(GridEvent<M> ce)
           
protected  void onKeyPress(GridEvent<M> e)
           
protected  void onKeyRight(GridEvent<M> ce)
           
protected  void onKeyUp(GridEvent<M> e)
           
protected  void onLastFocusChanged(M oldFocused, M newFocused)
           
protected  void onRowUpdated(GridEvent<M> ge)
           
protected  void onSelectChange(M model, boolean select)
           
 void selectNext(boolean keepexisting)
          Selects the next row.
 void selectPrevious(boolean keepexisting)
          Selects the previous row.
 void setMoveEditorOnEnter(boolean moveEditorOnEnter)
          Set this to true to move the editor to the next editable cell on pressing enter.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.selection.AbstractStoreSelectionModel
addSelectionChangedListener, deselect, deselect, deselect, deselect, deselect, deselectAll, doDeselect, doMultiSelect, doSelect, doSingleSelect, fireSelectionChange, getLastFocused, getSelectedItem, getSelectedItems, getSelection, getSelectionMode, isLocked, isSelected, onAdd, onClear, onRemove, onUpdate, refresh, removeSelectionListener, select, select, select, select, select, selectAll, setLastFocused, setLocked, setSelection, setSelectionMode
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enableNavKeys

protected boolean enableNavKeys

grid

protected Grid<M extends ModelData> grid

grouped

protected boolean grouped

groupingView

protected GroupingView groupingView

keyNav

protected KeyNav<GridEvent<M extends ModelData>> keyNav

listStore

protected ListStore<M extends ModelData> listStore

selectedGroup

protected com.google.gwt.user.client.Element selectedGroup

selectedHeader

protected ColumnHeader.Head selectedHeader
Constructor Detail

GridSelectionModel

public GridSelectionModel()
Method Detail

bind

public void bind(Store store)
Description copied from interface: StoreSelectionModel
Binds the store to the selection model.

Specified by:
bind in interface StoreSelectionModel<M extends ModelData>
Overrides:
bind in class AbstractStoreSelectionModel<M extends ModelData>
Parameters:
store - the bound store

bindGrid

public void bindGrid(Grid grid)

handleEvent

public void handleEvent(BaseEvent e)
Description copied from interface: Listener
Sent when an event that the listener has registered for occurs.

Specified by:
handleEvent in interface Listener<BaseEvent>
Parameters:
e - the event which occurred

isMoveEditorOnEnter

public boolean isMoveEditorOnEnter()
Returns true of the editor moves on enter.

Returns:
true if editor moves on enter

onEditorKey

public void onEditorKey(DomEvent e)

selectNext

public void selectNext(boolean keepexisting)
Selects the next row.

Parameters:
keepexisting - true to keep existing selections

selectPrevious

public void selectPrevious(boolean keepexisting)
Selects the previous row.

Parameters:
keepexisting - true to keep existing selections

setMoveEditorOnEnter

public void setMoveEditorOnEnter(boolean moveEditorOnEnter)
Set this to true to move the editor to the next editable cell on pressing enter.

Parameters:
moveEditorOnEnter - true to move the editor on pressing enter.

handleColumnHidden

protected void handleColumnHidden(ColumnModelEvent e)

handleMouseClick

protected void handleMouseClick(GridEvent<M> e)

handleMouseDown

protected void handleMouseDown(GridEvent<M> e)

hasNext

protected boolean hasNext()

hasPrevious

protected boolean hasPrevious()

isInput

protected boolean isInput(com.google.gwt.user.client.Element target)

isSelectable

protected boolean isSelectable(int row,
                               int cell,
                               boolean acceptsNav)

onKeyDown

protected void onKeyDown(GridEvent<M> e)

onKeyLeft

protected void onKeyLeft(GridEvent<M> ce)

onKeyPress

protected void onKeyPress(GridEvent<M> e)

onKeyRight

protected void onKeyRight(GridEvent<M> ce)

onKeyUp

protected void onKeyUp(GridEvent<M> e)

onLastFocusChanged

protected void onLastFocusChanged(M oldFocused,
                                  M newFocused)
Overrides:
onLastFocusChanged in class AbstractStoreSelectionModel<M extends ModelData>

onRowUpdated

protected void onRowUpdated(GridEvent<M> ge)

onSelectChange

protected void onSelectChange(M model,
                              boolean select)
Specified by:
onSelectChange in class AbstractStoreSelectionModel<M extends ModelData>