public class DefaultGridEventManager extends Object implements GridEventManager
MODIFIER_ALT, MODIFIER_CTRL, MODIFIER_META, MODIFIER_SHIFT
Constructor and Description |
---|
DefaultGridEventManager(GridPanel panel)
Creates an instance of the class and adds itself to the listeners list of the grid.
|
Modifier and Type | Method and Description |
---|---|
protected void |
activateCell()
Activates the currently selected cell
|
protected boolean |
deactivateActiveCell()
This method activates an active cell if there is one and if this cell allows
centralized deactivation by keyboard.
|
boolean |
dispatch(GridPanel panel,
char keyCode,
int modifiers)
This method dispatches events and performs actions related to a concrete combinations of
keys.
|
protected GridPanel |
getPanel()
Gets a grid panel instance.
|
int |
getSelectionModifier()
Gets a key code of selection modifier pressed by a user.
|
protected boolean |
isReadOnly()
Checks whether the current cell is read only.
|
protected boolean |
isSkipKeyboardEnabled()
Checks whether the current cell is enabled for activation / deactivation by keyboard events.
|
protected void |
moveByShiftTab()
Moves a cursor to the next left cell or to the previous line if the current cell is the first in the row.
|
protected void |
moveByTab()
Moves a cursor to the next right cell or to the next line if the current cell is last in the row.
|
protected void |
moveCursorDown()
Moves the cursor down
|
protected void |
moveCursorLeft()
Moves the cursor left
|
protected void |
moveCursorRight()
Moves the cursor right
|
protected void |
moveCursorUp()
Moves the cursor up
|
protected void |
moveToEndPage()
Opens the last page of the grid
|
protected void |
moveToFirstCell()
Moves the cursor to the first cell on this page
|
protected void |
moveToLastCell()
Moves the cursor to the last cell on this page
|
protected void |
moveToNextCell()
Moves the cursor to the next cell
|
protected void |
moveToNextPage()
Open the next page
|
protected void |
moveToPreviousCell()
Moves the cursor to the previous cell
|
protected void |
moveToPrevPage()
Opens the previous page
|
protected void |
moveToStartPage()
Opens the first page of the grid
|
void |
onBlur(com.google.gwt.event.dom.client.BlurEvent event)
Registers this class instance as a handler for native preview events.
|
void |
onClick(com.google.gwt.event.dom.client.ClickEvent event)
Sets the current position of the cursor or activates the selected cell.
|
void |
onFocus(com.google.gwt.event.dom.client.FocusEvent focusEvent)
Sets a position of the cursor
|
void |
onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)
Handles key down and key up events to dispatch key combination.
|
protected void |
setCursor(int row,
int cell,
boolean skipSelection)
This method sets the current cell value.
|
protected void |
setPage(int page)
Setter for property 'page'.
|
public DefaultGridEventManager(GridPanel panel)
panel
- is a grid panel.public boolean dispatch(GridPanel panel, char keyCode, int modifiers)
dispatch
in interface GridEventManager
panel
- is a grid panel that invokes the manager.keyCode
- is a key code.modifiers
- is a list of modifiers defined in KeyboardListener
.true
the original event
must be cancelled.public void onFocus(com.google.gwt.event.dom.client.FocusEvent focusEvent)
onFocus
in interface com.google.gwt.event.dom.client.FocusHandler
public void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
onBlur
in interface com.google.gwt.event.dom.client.BlurHandler
event
- is an original event that is never used.public void onClick(com.google.gwt.event.dom.client.ClickEvent event)
onClick
in interface com.google.gwt.event.dom.client.ClickHandler
public void onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)
onPreviewNativeEvent
in interface com.google.gwt.user.client.Event.NativePreviewHandler
event
- is an event that happens somewhere in the grid.protected void moveToNextCell()
protected void moveToPreviousCell()
protected void moveCursorRight()
protected void moveCursorDown()
protected void moveCursorLeft()
protected void moveCursorUp()
protected void moveToStartPage()
protected void moveToEndPage()
protected void moveToFirstCell()
protected void moveToLastCell()
protected void moveToNextPage()
protected void moveToPrevPage()
protected boolean deactivateActiveCell()
activateCell()
.true
if cell is deactivated.protected void moveByTab()
protected void moveByShiftTab()
protected void activateCell()
protected boolean isReadOnly()
true
if it's read only.protected boolean isSkipKeyboardEnabled()
true
if skip enabled for activation.protected void setPage(int page)
page
- Value to set for property 'page'.protected void setCursor(int row, int cell, boolean skipSelection)
row
- is a row number.cell
- is a column number.skipSelection
- is a flag value that forces selection skipping. Otherwise rows might be selected due to other
conditions.protected GridPanel getPanel()
public int getSelectionModifier()
Copyright © 2008–2013. All rights reserved.