com.extjs.gxt.ui.client.widget.grid
Class CellSelectionModel<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>
              extended by com.extjs.gxt.ui.client.widget.grid.CellSelectionModel<M>
Type Parameters:
M - the model type
All Implemented Interfaces:
Listener<BaseEvent>, Observable, SelectionProvider<M>, StoreSelectionModel<M>, java.util.EventListener
Direct Known Subclasses:
CellTreeGridSelectionModel

public class CellSelectionModel<M extends ModelData>
extends GridSelectionModel<M>

Cell based selection model for a grid.


Nested Class Summary
 class CellSelectionModel.CellSelection
           
 
Nested classes/interfaces inherited from class com.extjs.gxt.ui.client.widget.grid.GridSelectionModel
GridSelectionModel.Callback, GridSelectionModel.Cell
 
Field Summary
protected  CellSelectionModel.CellSelection selection
           
 
Fields inherited from class com.extjs.gxt.ui.client.widget.grid.GridSelectionModel
enableNavKeys, grid, grouped, groupingView, keyNav, listStore, selectedGroup, selectedHeader
 
Fields inherited from class com.extjs.gxt.ui.client.widget.selection.AbstractStoreSelectionModel
lastSelected, locked, selected, selectionMode, store, storeListener
 
Constructor Summary
CellSelectionModel()
           
 
Method Summary
 void bindGrid(Grid grid)
           
 void deselectAll()
          Deselects all selections.
 CellSelectionModel.CellSelection getSelectCell()
          Returns the selected cell.
 M getSelectedItem()
          Returns the selected item.
 java.util.List<M> getSelectedItems()
          Returns the selected items.
 void handleEvent(BaseEvent e)
          Sent when an event that the listener has registered for occurs.
protected  void handleMouseDown(GridEvent<M> e)
           
protected  void onClear(StoreEvent<M> se)
           
protected  void onKeyDown(GridEvent<M> e)
           
protected  void onKeyPress(GridEvent<M> e)
           
protected  void onKeyUp(GridEvent<M> e)
           
protected  void onRemove(M model)
           
protected  void onRowUpdated(GridEvent<M> ge)
           
 void selectCell(int row, int cell)
          Selects the cell.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.grid.GridSelectionModel
bind, handleColumnHidden, handleMouseClick, hasNext, hasPrevious, isInput, isMoveEditorOnEnter, isSelectable, onEditorKey, onKeyLeft, onKeyRight, onLastFocusChanged, onSelectChange, selectNext, selectPrevious, setMoveEditorOnEnter
 
Methods inherited from class com.extjs.gxt.ui.client.widget.selection.AbstractStoreSelectionModel
addSelectionChangedListener, deselect, deselect, deselect, deselect, deselect, doDeselect, doMultiSelect, doSelect, doSingleSelect, fireSelectionChange, getLastFocused, getSelection, getSelectionMode, isLocked, isSelected, onAdd, 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

selection

protected CellSelectionModel.CellSelection selection
Constructor Detail

CellSelectionModel

public CellSelectionModel()
Method Detail

bindGrid

public void bindGrid(Grid grid)
Overrides:
bindGrid in class GridSelectionModel<M extends ModelData>

deselectAll

public void deselectAll()
Description copied from interface: StoreSelectionModel
Deselects all selections.

Specified by:
deselectAll in interface StoreSelectionModel<M extends ModelData>
Overrides:
deselectAll in class AbstractStoreSelectionModel<M extends ModelData>

getSelectCell

public CellSelectionModel.CellSelection getSelectCell()
Returns the selected cell.

Returns:
the selection cell

getSelectedItem

public M getSelectedItem()
Description copied from interface: StoreSelectionModel
Returns the selected item.

Specified by:
getSelectedItem in interface StoreSelectionModel<M extends ModelData>
Overrides:
getSelectedItem in class AbstractStoreSelectionModel<M extends ModelData>

getSelectedItems

public java.util.List<M> getSelectedItems()
Description copied from interface: StoreSelectionModel
Returns the selected items.

Specified by:
getSelectedItems in interface StoreSelectionModel<M extends ModelData>
Overrides:
getSelectedItems in class AbstractStoreSelectionModel<M extends ModelData>

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>
Overrides:
handleEvent in class GridSelectionModel<M extends ModelData>
Parameters:
e - the event which occurred

selectCell

public void selectCell(int row,
                       int cell)
Selects the cell.

Parameters:
row - the row index
cell - the cell index

handleMouseDown

protected void handleMouseDown(GridEvent<M> e)
Overrides:
handleMouseDown in class GridSelectionModel<M extends ModelData>

onClear

protected void onClear(StoreEvent<M> se)
Overrides:
onClear in class AbstractStoreSelectionModel<M extends ModelData>

onKeyDown

protected void onKeyDown(GridEvent<M> e)
Overrides:
onKeyDown in class GridSelectionModel<M extends ModelData>

onKeyPress

protected void onKeyPress(GridEvent<M> e)
Overrides:
onKeyPress in class GridSelectionModel<M extends ModelData>

onKeyUp

protected void onKeyUp(GridEvent<M> e)
Overrides:
onKeyUp in class GridSelectionModel<M extends ModelData>

onRemove

protected void onRemove(M model)
Overrides:
onRemove in class AbstractStoreSelectionModel<M extends ModelData>

onRowUpdated

protected void onRowUpdated(GridEvent<M> ge)
Overrides:
onRowUpdated in class GridSelectionModel<M extends ModelData>