com.gwtext.client.core
Class EventObject

java.lang.Object
  extended by com.gwtext.client.core.JsObject
      extended by com.gwtext.client.core.EventObject

public class EventObject
extends JsObject

A normalized Event object. Can use DOM.eventGetType(Event) for determinint event type too.


Field Summary
static int BACKSPACE
           
static int CONTROL
           
static int DELETE
           
static int DOWN
           
static int END
           
static int ENTER
           
static int ESC
           
static int F5
           
static int HOME
           
static int LEFT
           
static int PAGEDOWN
           
static int PAGEUP
           
static int RETURN
           
static int RIGHT
           
static int SHIFT
           
static int SPACE
           
static int TAB
           
static int UP
           
 
Fields inherited from class com.gwtext.client.core.JsObject
jsObj
 
Constructor Summary
EventObject(com.google.gwt.core.client.JavaScriptObject jsObj)
           
 
Method Summary
 com.google.gwt.user.client.Event getBrowserEvent()
          Return the native browser event.
 int getCharCode()
          Gets the key code for the event.
 int getKey()
          Returns a normalized keyCode for the event.
 int getMouseButton()
           
 int getPageX()
          Gets the x coordinate of the event.
 int getPageY()
          Gets the y coordinate of the event.
 com.google.gwt.user.client.Element getRelatedTarget()
          Gets the related target.
 com.google.gwt.user.client.Element getTarget()
          Gets the target for the event.
 com.google.gwt.user.client.Element getTarget(java.lang.String selector, int maxDepth)
           
 double getTime()
           
 int getWheelDelta()
           
 int[] getXY()
          Gets the xy coordinates of the event.
 boolean hasModifier()
          Returns true if the control, meta, shift or alt key was pressed during this event.
static EventObject instance(com.google.gwt.core.client.JavaScriptObject event)
           
 boolean isAltKey()
          Return true if is Alt key.
 boolean isCtrlKey()
          Return true if is Ctrl key.
 boolean isShiftKey()
          Return true if is Shift key.
 void stopEvent()
          Stop the event (preventDefault and stopPropagation)
 void stopPropagation()
          Cancels bubbling of the event.
 boolean within(com.google.gwt.user.client.Element elem)
          Returns true if the target of this event equals el or is a child of el
 boolean within(java.lang.String id)
          Returns true if the target of this event equals el or is a child of el
 
Methods inherited from class com.gwtext.client.core.JsObject
getJsObj, getProperties, isCreated, setJsObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACKSPACE

public static int BACKSPACE

CONTROL

public static int CONTROL

DELETE

public static int DELETE

DOWN

public static int DOWN

END

public static int END

ENTER

public static int ENTER

ESC

public static int ESC

F5

public static int F5

HOME

public static int HOME

LEFT

public static int LEFT

PAGEDOWN

public static int PAGEDOWN

PAGEUP

public static int PAGEUP

RETURN

public static int RETURN

RIGHT

public static int RIGHT

SHIFT

public static int SHIFT

SPACE

public static int SPACE

TAB

public static int TAB

UP

public static int UP
Constructor Detail

EventObject

public EventObject(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail

instance

public static EventObject instance(com.google.gwt.core.client.JavaScriptObject event)

getCharCode

public int getCharCode()
Gets the key code for the event.

Returns:
the key code for the event.

getKey

public int getKey()
Returns a normalized keyCode for the event.

Returns:
a normalized keyCode for the event.

getRelatedTarget

public com.google.gwt.user.client.Element getRelatedTarget()
Gets the related target.

Returns:
the related target.

getTarget

public com.google.gwt.user.client.Element getTarget()
Gets the target for the event.

Returns:
the target for the event.

getTarget

public com.google.gwt.user.client.Element getTarget(java.lang.String selector,
                                                    int maxDepth)

getTime

public double getTime()

getWheelDelta

public int getWheelDelta()

getXY

public int[] getXY()
Gets the xy coordinates of the event.

Returns:
the xy coordinates of the event.

getPageX

public int getPageX()
Gets the x coordinate of the event.

Returns:
the x coordinate of the event.

getPageY

public int getPageY()
Gets the y coordinate of the event.

Returns:
the y coordinate of the event.

hasModifier

public boolean hasModifier()
Returns true if the control, meta, shift or alt key was pressed during this event.

Returns:
true if the control, meta, shift or alt key was pressed during this event.

stopEvent

public void stopEvent()
Stop the event (preventDefault and stopPropagation)


stopPropagation

public void stopPropagation()
Cancels bubbling of the event.


within

public boolean within(java.lang.String id)
Returns true if the target of this event equals el or is a child of el

Parameters:
id - the element ID
Returns:
true if target within

within

public boolean within(com.google.gwt.user.client.Element elem)
Returns true if the target of this event equals el or is a child of el

Parameters:
elem - the element
Returns:
true if target within

isAltKey

public boolean isAltKey()
Return true if is Alt key.

Returns:
true if is Alt key.

isCtrlKey

public boolean isCtrlKey()
Return true if is Ctrl key.

Returns:
true if is Ctrl key.

isShiftKey

public boolean isShiftKey()
Return true if is Shift key.

Returns:
true if is Shift key.

getMouseButton

public int getMouseButton()
Returns:
-1 = none, 0 = left, 1 = middle, 2 right

getBrowserEvent

public com.google.gwt.user.client.Event getBrowserEvent()
Return the native browser event.

Returns:
the native browser event