public class Event extends SimpleScriptable
Modifier and Type | Field and Description |
---|---|
static short |
AT_TARGET
The second event phase: at the event target.
|
static short |
BUBBLING_PHASE
The third (and final) event phase: the bubbling phase.
|
static short |
CAPTURING_PHASE
The first event phase: the capturing phase.
|
static String |
TYPE_BEFORE_UNLOAD
The beforeunload event type, triggered by "onbeforeunload" event handlers.
|
static String |
TYPE_BLUR
The blur event type, triggered by "onblur" event handlers.
|
static String |
TYPE_CHANGE
The change event type, triggered by "onchange" event handlers.
|
static String |
TYPE_DOM_DOCUMENT_LOADED
Triggered after the DOM has loaded but before images etc.
|
static String |
TYPE_FOCUS
The focus event type, triggered by "onfocus" event handlers.
|
static String |
TYPE_KEY_DOWN
The key down event type, triggered by "onkeydown" event handlers.
|
static String |
TYPE_KEY_PRESS
The key down event type, triggered by "onkeypress" event handlers.
|
static String |
TYPE_KEY_UP
The key down event type, triggered by "onkeyup" event handlers.
|
static String |
TYPE_LOAD
The load event type, triggered by "onload" event handlers.
|
static String |
TYPE_RESET
The submit event type, triggered by "onreset" event handlers.
|
static String |
TYPE_SUBMIT
The submit event type, triggered by "onsubmit" event handlers.
|
static String |
TYPE_UNLOAD
The unload event type, triggered by "onunload" event handlers.
|
Constructor and Description |
---|
Event()
Used to build the prototype.
|
Event(DomNode domNode,
String type)
Creates a new event instance.
|
Event(DomNode domNode,
String type,
boolean shiftKey,
boolean ctrlKey,
boolean altKey)
Creates a new event instance.
|
Event(DomNode domNode,
String type,
int keyCode,
boolean shiftKey,
boolean ctrlKey,
boolean altKey)
Creates a new event instance for a keypress event.
|
Modifier and Type | Method and Description |
---|---|
void |
copyPropertiesFrom(Event event)
Copies properties from another event to this event.
|
boolean |
isPreventDefault()
Returns if the preventDefault() method has been called for this event.
|
boolean |
isPropagationStopped()
Indicates if event propagation is stopped.
|
void |
jsxFunction_initEvent(String type,
boolean bubbles,
boolean cancelable)
Initializes this event.
|
void |
jsxFunction_preventDefault()
If, during any stage of event flow, this method is called the event is canceled.
|
void |
jsxFunction_stopPropagation()
Stops the event from propagating.
|
boolean |
jsxGet_altKey() |
boolean |
jsxGet_bubbles() |
boolean |
jsxGet_cancelable() |
boolean |
jsxGet_cancelBubble() |
boolean |
jsxGet_ctrlKey() |
Object |
jsxGet_currentTarget()
Returns the event target whose event listeners are currently being processed.
|
int |
jsxGet_eventPhase() |
Object |
jsxGet_keyCode()
Returns the key code associated with the event.
|
Object |
jsxGet_returnValue()
Returns the return value associated with the event.
|
boolean |
jsxGet_shiftKey() |
Object |
jsxGet_srcElement()
Returns the object that fired the event.
|
Object |
jsxGet_target()
Returns the event target to which the event was originally dispatched.
|
long |
jsxGet_timeStamp()
Returns the time at which this event was created.
|
String |
jsxGet_type()
Returns the event type.
|
void |
jsxSet_cancelBubble(boolean newValue) |
void |
jsxSet_returnValue(Object returnValue)
Sets the return value associated with the event.
|
void |
jsxSet_srcElement(Object srcElement)
Sets the object that fired the event.
|
protected void |
setAltKey(boolean altKey) |
protected void |
setCtrlKey(boolean ctrlKey) |
void |
setCurrentTarget(org.mozilla.javascript.Scriptable target)
Sets the current target
|
void |
setEventPhase(short phase)
Sets the current event phase.
|
void |
setEventType(String eventType)
Sets the event type.
|
protected void |
setShiftKey(boolean shiftKey) |
String |
toString() |
get, getBooleanArg, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getIntArg, getLog, getObjectArg, getPrototype, getScriptableFor, getStartingScope, getStringArg, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, makeScriptableFor, setDomNode, setDomNode, setHtmlElement
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
public static final String TYPE_SUBMIT
public static final String TYPE_CHANGE
public static final String TYPE_LOAD
public static final String TYPE_UNLOAD
public static final String TYPE_FOCUS
public static final String TYPE_BLUR
public static final String TYPE_KEY_DOWN
public static final String TYPE_KEY_PRESS
public static final String TYPE_KEY_UP
public static final String TYPE_RESET
public static final String TYPE_BEFORE_UNLOAD
public static final String TYPE_DOM_DOCUMENT_LOADED
public static final short CAPTURING_PHASE
public static final short AT_TARGET
public static final short BUBBLING_PHASE
public Event(DomNode domNode, String type)
domNode
- The DOM node that triggered the event.type
- The event type.public Event(DomNode domNode, String type, boolean shiftKey, boolean ctrlKey, boolean altKey)
domNode
- The DOM node that triggered the event.type
- The event type.shiftKey
- true if SHIFT is pressedctrlKey
- true if CTRL is pressedaltKey
- true if ALT is pressedpublic Event(DomNode domNode, String type, int keyCode, boolean shiftKey, boolean ctrlKey, boolean altKey)
domNode
- the DOM node that triggered the event.type
- The event type.keyCode
- The key code associated with the event.shiftKey
- true if SHIFT is pressedctrlKey
- true if CTRL is pressedaltKey
- true if ALT is pressedpublic Event()
public Object jsxGet_srcElement()
public void jsxSet_srcElement(Object srcElement)
srcElement
- The object that fired the event.public Object jsxGet_target()
public Object jsxGet_currentTarget()
public void setCurrentTarget(org.mozilla.javascript.Scriptable target)
target
- the new valuepublic String jsxGet_type()
public void setEventType(String eventType)
eventType
- The event type.public long jsxGet_timeStamp()
public Object jsxGet_keyCode()
public boolean jsxGet_shiftKey()
protected void setShiftKey(boolean shiftKey)
shiftKey
- whether SHIFT has been pressed during this event or not.public boolean jsxGet_ctrlKey()
protected void setCtrlKey(boolean ctrlKey)
ctrlKey
- whether CTRL has been pressed during this event or not.public boolean jsxGet_altKey()
protected void setAltKey(boolean altKey)
altKey
- whether ALT has been pressed during this event or not.public int jsxGet_eventPhase()
public void setEventPhase(short phase)
phase
- the phase the event is inpublic boolean jsxGet_bubbles()
public boolean jsxGet_cancelable()
public boolean jsxGet_cancelBubble()
public void jsxSet_cancelBubble(boolean newValue)
newValue
- indicates if event propagation is stopped.public void jsxFunction_stopPropagation()
public boolean isPropagationStopped()
public Object jsxGet_returnValue()
public void jsxSet_returnValue(Object returnValue)
returnValue
- The return value associated with the event.public void jsxFunction_initEvent(String type, boolean bubbles, boolean cancelable)
type
- the event typebubbles
- whether or not the event should bubblecancelable
- whether or not the event the event should be cancelablepublic void jsxFunction_preventDefault()
public boolean isPreventDefault()
public void copyPropertiesFrom(Event event)
event
- the event to copy the properties fromCopyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.