public class Event extends SimpleScriptable
Modifier and Type | Field and Description |
---|---|
static int |
ABORT
Constant.
|
static int |
ALT_MASK
Constant.
|
static short |
AT_TARGET
The second event phase: at the event target.
|
static int |
BACK
Constant.
|
static int |
BLUR
Constant.
|
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 int |
CHANGE
Constant.
|
static int |
CLICK
Constant.
|
static int |
CONTROL_MASK
Constant.
|
static int |
DBLCLICK
Constant.
|
static int |
DRAGDROP
Constant.
|
static int |
ERROR
Constant.
|
static int |
FOCUS
Constant.
|
static int |
FORWARD
Constant.
|
static int |
HELP
Constant.
|
static int |
KEYDOWN
Constant.
|
static int |
KEYPRESS
Constant.
|
static int |
KEYUP
Constant.
|
static int |
LOAD
Constant.
|
static int |
LOCATE
Constant.
|
static int |
META_MASK
Constant.
|
static int |
MOUSEDOWN
Constant.
|
static int |
MOUSEDRAG
Constant.
|
static int |
MOUSEMOVE
Constant.
|
static int |
MOUSEOUT
Constant.
|
static int |
MOUSEOVER
Constant.
|
static int |
MOUSEUP
Constant.
|
static int |
MOVE
Constant.
|
static int |
RESET
Constant.
|
static int |
RESIZE
Constant.
|
static int |
SCROLL
Constant.
|
static int |
SELECT
Constant.
|
static int |
SHIFT_MASK
Constant.
|
static int |
SUBMIT
Constant.
|
static int |
TEXT
Constant.
|
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_ERROR
The event type triggered by "onerror" event handlers.
|
static String |
TYPE_FOCUS
The focus event type, triggered by "onfocus" event handlers.
|
static String |
TYPE_FOCUS_IN
The focus in event type, triggered by "onfocusin" event handlers.
|
static String |
TYPE_FOCUS_OUT
The focus out event type, triggered by "onfocusout" event handlers.
|
static String |
TYPE_INPUT
The input event type, triggered by "oninput" 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_PROPERTY_CHANGE
The event type triggered by "onpropertychange" event handlers.
|
static String |
TYPE_READY_STATE_CHANGE
The event type triggered by "onreadystatechange" 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.
|
static int |
UNLOAD
Constant.
|
static int |
XFER_DONE
Constant.
|
Constructor and Description |
---|
Event()
Used to build the prototype.
|
Event(DomNode domNode,
String type)
Creates a new event instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
applies(DomNode node)
Indicates if the current event can be applied to the provided node.
|
static Event |
createPropertyChangeEvent(DomNode domNode,
String propertyName)
Creates a new Event with
TYPE_PROPERTY_CHANGE type. |
boolean |
isAborted(ScriptResult result)
Returns true if this event has been aborted via preventDefault() in
standards-compliant browsers, or via the event's returnValue property in IE, or
by the event handler returning false.
|
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.
|
String |
jsxGet_propertyName()
Returns the property name 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(net.sourceforge.htmlunit.corejs.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 |
setKeyCode(Object keyCode)
Sets the key code.
|
protected void |
setShiftKey(boolean shiftKey) |
void |
setTarget(Object target)
Sets the event target.
|
String |
toString() |
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size
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_FOCUS_IN
public static final String TYPE_FOCUS_OUT
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_INPUT
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 String TYPE_PROPERTY_CHANGE
public static final String TYPE_READY_STATE_CHANGE
public static final String TYPE_ERROR
public static final short CAPTURING_PHASE
public static final short AT_TARGET
public static final short BUBBLING_PHASE
public static final int ABORT
public static final int ALT_MASK
public static final int BACK
public static final int BLUR
public static final int CHANGE
public static final int CLICK
public static final int CONTROL_MASK
public static final int DBLCLICK
public static final int DRAGDROP
public static final int ERROR
public static final int FOCUS
public static final int FORWARD
public static final int HELP
public static final int KEYDOWN
public static final int KEYPRESS
public static final int KEYUP
public static final int LOAD
public static final int LOCATE
public static final int META_MASK
public static final int MOUSEDOWN
public static final int MOUSEDRAG
public static final int MOUSEMOVE
public static final int MOUSEOUT
public static final int MOUSEOVER
public static final int MOUSEUP
public static final int MOVE
public static final int RESET
public static final int RESIZE
public static final int SCROLL
public static final int SELECT
public static final int SHIFT_MASK
public static final int SUBMIT
public static final int TEXT
public static final int UNLOAD
public static final int XFER_DONE
public Event(DomNode domNode, String type)
domNode
- the DOM node that triggered the eventtype
- the event typepublic Event()
public static Event createPropertyChangeEvent(DomNode domNode, String propertyName)
TYPE_PROPERTY_CHANGE
type.domNode
- the DOM node that triggered the eventpropertyName
- the property name that was changedpublic Object jsxGet_srcElement()
public void jsxSet_srcElement(Object srcElement)
srcElement
- the object that fired the eventpublic Object jsxGet_target()
public void setTarget(Object target)
target
- the event targetpublic Object jsxGet_currentTarget()
public void setCurrentTarget(net.sourceforge.htmlunit.corejs.javascript.Scriptable target)
target
- the new valuepublic String jsxGet_type()
public void setEventType(String eventType)
eventType
- the event typepublic long jsxGet_timeStamp()
protected void setKeyCode(Object keyCode)
keyCode
- the virtual key code value of the key which was depressed, otherwise zeropublic Object jsxGet_keyCode()
public boolean jsxGet_shiftKey()
protected void setShiftKey(boolean shiftKey)
shiftKey
- whether SHIFT has been pressed during this event or notpublic boolean jsxGet_ctrlKey()
protected void setCtrlKey(boolean ctrlKey)
ctrlKey
- whether CTRL has been pressed during this event or notpublic boolean jsxGet_altKey()
protected void setAltKey(boolean altKey)
altKey
- whether ALT has been pressed during this event or notpublic 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 stoppedpublic void jsxFunction_stopPropagation()
public boolean isPropagationStopped()
public Object jsxGet_returnValue()
public String jsxGet_propertyName()
public void jsxSet_returnValue(Object returnValue)
returnValue
- the return value associated with the eventpublic 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 isAborted(ScriptResult result)
result
- the event handler result (if false, the event is considered aborted)public boolean applies(DomNode node)
node
- the node to testfalse
if the event can't be appliedCopyright © 2002–2015 Gargoyle Software Inc.. All rights reserved.