public class KeyPressEvent extends AbstractSmartEvent<KeyPressHandler> implements Cancellable
GwtEvent.Type<H>
jsObj
Constructor and Description |
---|
KeyPressEvent(JavaScriptObject jsObj) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Call this method to attempt to cancel the event.
|
protected void |
dispatch(KeyPressHandler handler) |
static <S extends HasKeyPressHandlers & HasHandlers> |
fire(S source,
JavaScriptObject jsObj)
Fires a open event on all registered handlers in the handler manager.If no
such handlers exist, this method will do nothing.
|
GwtEvent.Type<KeyPressHandler> |
getAssociatedType() |
java.lang.Integer |
getCharacterValue()
If this was a character key, this is the numeric value for the character
|
DynamicForm |
getForm()
Pointer to the item's form
|
FormItem |
getItem()
Item over which the keypress occurred
|
java.lang.String |
getKeyName()
Name of the key pressed (Example:
"A" , "Enter" ) |
static GwtEvent.Type<KeyPressHandler> |
getType()
Gets the type associated with this event.
|
boolean |
isAltKeyDown()
Helper method pointing to
EventHandler.altKeyDown() |
boolean |
isCancelled() |
boolean |
isCtrlKeyDown()
Helper method pointing to
EventHandler.ctrlKeyDown() |
boolean |
isShiftKeyDown()
Helper method pointing to
EventHandler.shiftKeyDown() |
assertLive, getSource, isLive, kill, revive
setSource, toDebugString, toString
public KeyPressEvent(JavaScriptObject jsObj)
public static <S extends HasKeyPressHandlers & HasHandlers> void fire(S source, JavaScriptObject jsObj)
S
- The event sourcesource
- the source of the handlersjsObj
- the native eventpublic static GwtEvent.Type<KeyPressHandler> getType()
protected void dispatch(KeyPressHandler handler)
dispatch
in class GwtEvent<KeyPressHandler>
public final GwtEvent.Type<KeyPressHandler> getAssociatedType()
getAssociatedType
in class GwtEvent<KeyPressHandler>
public void cancel()
FormItem.change()
or FormItem.transformInput()
instead.cancel
in interface Cancellable
public boolean isCancelled()
isCancelled
in interface Cancellable
public FormItem getItem()
public DynamicForm getForm()
public java.lang.String getKeyName()
"A"
, "Enter"
)"A"
, "Enter"
)public java.lang.Integer getCharacterValue()
public final boolean isAltKeyDown()
EventHandler.altKeyDown()
public final boolean isCtrlKeyDown()
EventHandler.ctrlKeyDown()
public final boolean isShiftKeyDown()
EventHandler.shiftKeyDown()