Class Event
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.javascript.HtmlUnitScriptable
-
- org.htmlunit.javascript.host.event.Event
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.htmlunit.corejs.javascript.ConstProperties,org.htmlunit.corejs.javascript.debug.DebuggableObject,org.htmlunit.corejs.javascript.Scriptable,org.htmlunit.corejs.javascript.SymbolScriptable
- Direct Known Subclasses:
AnimationEvent,AudioProcessingEvent,BeforeInstallPromptEvent,BeforeUnloadEvent,BlobEvent,ClipboardEvent,CloseEvent,CustomEvent,DeviceMotionEvent,DeviceOrientationEvent,ErrorEvent,GamepadEvent,HashChangeEvent,IDBVersionChangeEvent,MediaEncryptedEvent,MediaKeyError,MediaKeyMessageEvent,MediaQueryListEvent,MediaStreamEvent,MediaStreamTrackEvent,MessageEvent,MIDIConnectionEvent,MIDIMessageEvent,MutationEvent,OfflineAudioCompletionEvent,PageTransitionEvent,PopStateEvent,PresentationConnectionAvailableEvent,PresentationConnectionCloseEvent,ProgressEvent,PromiseRejectionEvent,RTCDataChannelEvent,RTCPeerConnectionIceEvent,SecurityPolicyViolationEvent,SpeechSynthesisEvent,StorageEvent,SubmitEvent,TimeEvent,TrackEvent,TransitionEvent,UIEvent,WebGLContextEvent,WebkitSpeechRecognitionError,WebkitSpeechRecognitionEvent
public class Event extends HtmlUnitScriptable
JavaScript object representing an event that is passed into event handlers when they are invoked. For general information on which properties and functions should be supported, see the mozilla docs, the W3C DOM Level 2 Event Documentation or IE's IHTMLEventObj interface.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intALT_MASKConstant.private booleanaltKey_static intAT_TARGETThe second event phase: at the event target.private booleanbubbles_Whether or not the event bubbles.static intBUBBLING_PHASEThe third (and final) event phase: the bubbling phase.private booleancancelable_Whether or not the event can be canceled.static intCAPTURING_PHASEThe first event phase: the capturing phase.static intCONTROL_MASKConstant.private booleanctrlKey_private org.htmlunit.corejs.javascript.ScriptablecurrentTarget_private inteventPhase_The current event phase.protected static java.lang.StringKEY_CURRENT_EVENTKey to place the event's target in the Context's scope during event processing to compute node coordinates compatible with those of the event.private intkeyCode_static intMETA_MASKConstant.static intNONENo event phase.private booleanpreventDefault_private java.lang.StringpropertyName_static intSHIFT_MASKConstant.private booleanshiftKey_private java.lang.ObjectsrcElement_private booleanstopImmediatePropagation_private booleanstopPropagation_private EventTargettarget_private longtimeStamp_The time at which the event was created.private java.lang.Stringtype_static java.lang.StringTYPE_ABORTThe abort event type, triggered byonabortevent handlers.static java.lang.StringTYPE_AFTERPRINTThe afterprint event type, triggered byafterprintevent handlers.static java.lang.StringTYPE_AFTERSCRIPTEXECUTEThe afterscriptexecute event type, triggered byafterscriptexecuteevent handlers.static java.lang.StringTYPE_ANIMATIONCANCELThe animationcancel event type, triggered byanimationcancelevent handlers.static java.lang.StringTYPE_ANIMATIONENDThe animationend event type, triggered byanimationendevent handlers.static java.lang.StringTYPE_ANIMATIONITERATIONThe animationiteration event type, triggered byanimationiterationevent handlers.static java.lang.StringTYPE_ANIMATIONSTARTThe animationstart event type, triggered byanimationstartevent handlers.static java.lang.StringTYPE_AUXCLICKThe auxclick event type, triggered byauxclickevent handlers.static java.lang.StringTYPE_BEFORE_UNLOADThe beforeunload event type, triggered byonbeforeunloadevent handlers.static java.lang.StringTYPE_BEFORECOPYThe beforecopy event type, triggered bybeforecopyevent handlers.static java.lang.StringTYPE_BEFORECUTThe beforecut event type, triggered bybeforecutevent handlers.static java.lang.StringTYPE_BEFOREPASTEThe beforepaste event type, triggered bybeforepasteevent handlers.static java.lang.StringTYPE_BEFOREPRINTThe beforeprint event type, triggered bybeforeprintevent handlers.static java.lang.StringTYPE_BEFORESCRIPTEXECUTEThe beforescriptexecute event type, triggered bybeforescriptexecuteevent handlers.static java.lang.StringTYPE_BLURThe blur event type, triggered byonblurevent handlers.static java.lang.StringTYPE_CANCELThe cancel event type, triggered bycancelevent handlers.static java.lang.StringTYPE_CANPLAYThe canplay event type, triggered bycanplayevent handlers.static java.lang.StringTYPE_CANPLAYTHROUGHThe canplaythrough event type, triggered bycanplaythroughevent handlers.static java.lang.StringTYPE_CHANGEThe change event type, triggered byonchangeevent handlers.static java.lang.StringTYPE_CLOSEThe close event type, triggered byoncloseevent handlers.static java.lang.StringTYPE_COPYThe copy event type, triggered bycopyevent handlers.static java.lang.StringTYPE_CUECHANGEThe cuechange event type, triggered bycuechangeevent handlers.static java.lang.StringTYPE_CUTThe cut event type, triggered bycutevent handlers.static java.lang.StringTYPE_DEVICEMOTIONThe devicemotion event type, triggered bydevicemotionevent handlers.static java.lang.StringTYPE_DEVICEORIENTATIONThe deviceorientation event type, triggered bydeviceorientationevent handlers.static java.lang.StringTYPE_DEVICEORIENTATIONABSOLUTEThe deviceorientationabsolute event type, triggered bydeviceorientationabsoluteevent handlers.static java.lang.StringTYPE_DOM_DOCUMENT_LOADEDTriggered after the DOM has loaded but before images etc.static java.lang.StringTYPE_DRAGThe drag event type, triggered bydragevent handlers.static java.lang.StringTYPE_DRAGENDThe dragend event type, triggered bydragendevent handlers.static java.lang.StringTYPE_DRAGENTERThe dragenter event type, triggered bydragenterevent handlers.static java.lang.StringTYPE_DRAGLEAVEThe dragleave event type, triggered bydragleaveevent handlers.static java.lang.StringTYPE_DRAGOVERThe dragover event type, triggered bydragoverevent handlers.static java.lang.StringTYPE_DRAGSTARTThe dragstart event type, triggered bydragstartevent handlers.static java.lang.StringTYPE_DROPThe drop event type, triggered bydropevent handlers.static java.lang.StringTYPE_DURATIONCHANGEThe durationchange event type, triggered bydurationchangeevent handlers.static java.lang.StringTYPE_EMPTIEDThe emptied event type, triggered byemptiedevent handlers.static java.lang.StringTYPE_ENDEDThe ended event type, triggered byendedevent handlers.static java.lang.StringTYPE_ERRORThe event type triggered byonerrorevent handlers.static java.lang.StringTYPE_FOCUSThe focus event type, triggered byonfocusevent handlers.static java.lang.StringTYPE_FOCUS_INThe focus in event type, triggered byonfocusinevent handlers.static java.lang.StringTYPE_FOCUS_OUTThe focus out event type, triggered byonfocusoutevent handlers.static java.lang.StringTYPE_GAMEPAD_CONNECTEDThe ongamepadconnected event type, triggered byongamepadconnectedevent handlers.static java.lang.StringTYPE_GAMEPAD_DISCONNECTEDThe ongamepaddisconnected event type, triggered byongamepaddisconnectedevent handlers.static java.lang.StringTYPE_GOTPOINTERCAPTUREThe gotpointercapture event type, triggered bygotpointercaptureevent handlers.static java.lang.StringTYPE_HASH_CHANGEThe event type triggered byonhashchangeevent handlers.static java.lang.StringTYPE_INPUTThe input event type, triggered byoninputevent handlers.static java.lang.StringTYPE_INVALIDThe invalid event type, triggered byinvalidevent handlers.static java.lang.StringTYPE_KEY_DOWNThe key down event type, triggered byonkeydownevent handlers.static java.lang.StringTYPE_KEY_PRESSThe key down event type, triggered byonkeypressevent handlers.static java.lang.StringTYPE_KEY_UPThe key down event type, triggered byonkeyupevent handlers.static java.lang.StringTYPE_LANGUAGECHANGEThe languagechange event type, triggered bylanguagechangeevent handlers.static java.lang.StringTYPE_LOADThe load event type, triggered byonloadevent handlers.static java.lang.StringTYPE_LOAD_ENDThe load end event type, triggered byonloadendevent handlers.static java.lang.StringTYPE_LOAD_STARTThe load start event type, triggered byonloadstartevent handlers.static java.lang.StringTYPE_LOADEDDATAThe loadeddata event type, triggered byloadeddataevent handlers.static java.lang.StringTYPE_LOADEDMETADATAThe loadedmetadata event type, triggered byloadedmetadataevent handlers.static java.lang.StringTYPE_LOSTPOINTERCAPTUREThe lostpointercapture event type, triggered bylostpointercaptureevent handlers.static java.lang.StringTYPE_MESSAGEThe message event type, triggered by postMessage.static java.lang.StringTYPE_MOUDEENTERThe mouseenter event type, triggered bymouseenterevent handlers.static java.lang.StringTYPE_MOUSELEAVEThe mouseleave event type, triggered bymouseleaveevent handlers.static java.lang.StringTYPE_MOUSEWHEELThe mousewheel event type, triggered bymousewheelevent handlers.static java.lang.StringTYPE_MOZFULLSCREENCHANGEThe mozfullscreenchange event type, triggered bymozfullscreenchangeevent handlers.static java.lang.StringTYPE_MOZFULLSCREENERRORThe mozfullscreenerror event type, triggered bymozfullscreenerrorevent handlers.static java.lang.StringTYPE_MSSITEMODEJUMPLISTITEMREMOVEDThe mssitemodejumplistitemremoved event type, triggered bymssitemodejumplistitemremovedevent handlers.static java.lang.StringTYPE_OFFLINEThe offline event type, triggered byofflineevent handlers.static java.lang.StringTYPE_ONLINEThe online event type, triggered byonlineevent handlers.static java.lang.StringTYPE_ONMESSAGEERRORThe onmessageerror event type, triggered byonmessageerrorevent handlers.static java.lang.StringTYPE_ONTRANSITIONCANCELThe ontransitioncancel event type, triggered byontransitioncancelevent handlers.static java.lang.StringTYPE_ONTRANSITIONENDThe ontransitionend event type, triggered byontransitionendevent handlers.static java.lang.StringTYPE_ONTRANSITIONRUNThe ontransitionrun event type, triggered byontransitionrunevent handlers.static java.lang.StringTYPE_ONTRANSITIONSTARTThe ontransitionstart event type, triggered byontransitionstartevent handlers.static java.lang.StringTYPE_OPENThe open event type, triggered byonopenevent handlers.static java.lang.StringTYPE_PAGEHIDEThe pagehide event type, triggered bypagehideevent handlers.static java.lang.StringTYPE_PAGESHOWThe pageshow event type, triggered bypageshowevent handlers.static java.lang.StringTYPE_PASTEThe paste event type, triggered bypasteevent handlers.static java.lang.StringTYPE_PAUSEThe pause event type, triggered bypauseevent handlers.static java.lang.StringTYPE_PLAYThe play event type, triggered byplayevent handlers.static java.lang.StringTYPE_PLAYINGThe playing event type, triggered byplayingevent handlers.static java.lang.StringTYPE_POINTERCANCELThe pointercancel event type, triggered bypointercancelevent handlers.static java.lang.StringTYPE_POINTERDOWNThe pointerdown event type, triggered bypointerdownevent handlers.static java.lang.StringTYPE_POINTERENTERThe pointerenter event type, triggered bypointerenterevent handlers.static java.lang.StringTYPE_POINTERLEAVEThe pointerleave event type, triggered bypointerleaveevent handlers.static java.lang.StringTYPE_POINTERLOCKCHANGEThe pointerlockchange event type, triggered bypointerlockchangeevent handlers.static java.lang.StringTYPE_POINTERLOCKERRORThe pointerlockerror event type, triggered bypointerlockerrorevent handlers.static java.lang.StringTYPE_POINTERMOVEThe pointermove event type, triggered bypointermoveevent handlers.static java.lang.StringTYPE_POINTEROUTThe pointerout event type, triggered bypointeroutevent handlers.static java.lang.StringTYPE_POINTEROVERThe pointerover event type, triggered bypointeroverevent handlers.static java.lang.StringTYPE_POINTERUPThe pointerup event type, triggered bypointerupevent handlers.static java.lang.StringTYPE_POPSTATEThe popstate event type, triggered byonpopstateevent handlers.static java.lang.StringTYPE_PROGRESSThe progress event type, triggered byonprogressevent handlers.static java.lang.StringTYPE_PROPERTY_CHANGEThe event type triggered byonpropertychangeevent handlers.static java.lang.StringTYPE_RATECHANGEThe ratechange event type, triggered byratechangeevent handlers.static java.lang.StringTYPE_READY_STATE_CHANGEThe event type triggered byonreadystatechangeevent handlers.static java.lang.StringTYPE_REJECTIONHANDLEDThe rejectionhandled event type, triggered byrejectionhandledevent handlers.static java.lang.StringTYPE_RESETThe submit event type, triggered byonresetevent handlers.static java.lang.StringTYPE_RESIZEThe resize event type, triggered byresizeevent handlers.static java.lang.StringTYPE_SCROLLThe scroll event type, triggered byonscrollevent handlers.static java.lang.StringTYPE_SCROLLENDThe scroll event type, triggered byonscrollendevent handlers.static java.lang.StringTYPE_SEARCHThe search event type, triggered byonsearchevent handlers.static java.lang.StringTYPE_SEEKEDThe seeked event type, triggered byseekedevent handlers.static java.lang.StringTYPE_SEEKINGThe seeking event type, triggered byseekingevent handlers.static java.lang.StringTYPE_SELECTThe select event type, triggered byselectevent handlers.static java.lang.StringTYPE_SELECTIONCHANGEThe selectionchange event type, triggered byselectionchangeevent handlers.static java.lang.StringTYPE_SELECTSTARTThe selectstart event type, triggered byselectstartevent handlers.static java.lang.StringTYPE_STALLEDThe stalled event type, triggered bystalledevent handlers.static java.lang.StringTYPE_STORAGEThe storage event type, triggered bystorageevent handlers.static java.lang.StringTYPE_SUBMITThe submit event type, triggered byonsubmitevent handlers.static java.lang.StringTYPE_SUSPENDThe suspend event type, triggered bysuspendevent handlers.static java.lang.StringTYPE_TIMEOUTThe timeout event type, triggered byontimeoutevent handlers.static java.lang.StringTYPE_TIMEUPDATEThe timeupdate event type, triggered bytimeupdateevent handlers.static java.lang.StringTYPE_TOGGLEThe toggle event type, triggered bytoggleevent handlers.static java.lang.StringTYPE_TRANSITIONENDThe transitionend event type, triggered bytransitionendevent handlers.static java.lang.StringTYPE_UNHANDLEDREJECTIONThe unhandledrejection event type, triggered byunhandledrejectionevent handlers.static java.lang.StringTYPE_UNLOADThe unload event type, triggered byonunloadevent handlers.static java.lang.StringTYPE_VOLUMECHANGEThe volumechange event type, triggered byvolumechangeevent handlers.static java.lang.StringTYPE_WAITINGThe waiting event type, triggered bywaitingevent handlers.static java.lang.StringTYPE_WEBANIMATIONSTARTThe webkitanimationstart event type, triggered bywebkitanimationstartevent handlers.static java.lang.StringTYPE_WEBKITANIMATIONENDThe webkitanimationend event type, triggered bywebkitanimationendevent handlers.static java.lang.StringTYPE_WEBKITANIMATIONITERATIONThe webkitanimationiteration event type, triggered bywebkitanimationiterationevent handlers.static java.lang.StringTYPE_WEBKITFULLSCREENCHANGEThe webkitfullscreenchange event type, triggered bywebkitfullscreenchangeevent handlers.static java.lang.StringTYPE_WEBKITFULLSCREENERRORThe webkitfullscreenerror event type, triggered bywebkitfullscreenerrorevent handlers.static java.lang.StringTYPE_WEBKITTRANSITIONENDThe webkittransitionend event type, triggered bywebkittransitionendevent handlers.static java.lang.StringTYPE_WHEELThe wheel event type, triggered bywheelevent handlers.
-
Constructor Summary
Constructors Constructor Description Event()Used to build the prototype.Event(DomNode domNode, java.lang.String type)Creates a new event instance.Event(EventTarget target, java.lang.String type)Creates a new event instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EventcreatePropertyChangeEvent(DomNode domNode, java.lang.String propertyName)Creates a new Event withTYPE_PROPERTY_CHANGEtype.voidendFire()Called when the event being fired ends.voideventCreated()Called whenever an event is created usingDocument.createEvent(..).java.lang.ObjectgetComposed()org.htmlunit.corejs.javascript.ScriptablegetCurrentTarget()Returns the event target whose event listeners are currently being processed.intgetEventPhase()Returns the current event phase for the event.intgetKeyCode()Returns the key code associated with the event.java.lang.StringgetPropertyName()Returns the property name associated with the event.java.lang.ObjectgetReturnValue()java.lang.ObjectgetSrcElement()Returns the object that fired the event.java.lang.ObjectgetTarget()Returns the event target to which the event was originally dispatched.longgetTimeStamp()Returns the time at which this event was created.java.lang.StringgetType()Returns the event type.(package private) voidhandlePropertyHandlerReturnValue(java.lang.Object returnValue)Handles the return values of property handlers.voidinitEvent(java.lang.String type, boolean bubbles, boolean cancelable)Initializes this event.booleanisAborted(ScriptResult result)Returnstrueif this event has been aborted viapreventDefault()in standards-compliant browsers.booleanisAltKey()Returns whetherALThas been pressed during this event or not.booleanisBubbles()booleanisCancelable()booleanisCancelBubble()booleanisCtrlKey()Returns whetherCTRLhas been pressed during this event or not.booleanisDefaultPrevented()Returnstrueif bothcancelableistrueandpreventDefault()has been called for this event.booleanisImmediatePropagationStopped()Indicates if event immediate propagation is stopped.protected static booleanisMissingOrUndefined(java.lang.Object value)Returns whether the given value indicates a missing or undefined property.booleanisPropagationStopped()Indicates if event propagation is stopped.booleanisShiftKey()Returns whetherSHIFThas been pressed during this event or not.voidjsConstructor(java.lang.String type, org.htmlunit.corejs.javascript.ScriptableObject details)JavaScript constructor.voidpreventDefault()If, during any stage of event flow, this method is called the event is canceled.booleanprocessLabelAfterBubbling()INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
If we click on a label, we have to simulate a click on the element referenced by the 'for' attribute also.protected voidsetAltKey(boolean altKey)Sets whetherALTkey is pressed on not.protected voidsetBubbles(boolean bubbles)protected voidsetCancelable(boolean cancelable)voidsetCancelBubble(boolean newValue)protected voidsetCtrlKey(boolean ctrlKey)Sets whetherCTRLkey is pressed on not.voidsetCurrentTarget(org.htmlunit.corejs.javascript.Scriptable target)Sets the current target.voidsetEventPhase(int phase)Sets the current event phase.voidsetEventType(java.lang.String eventType)Sets the event type.protected voidsetKeyCode(int keyCode)Sets the key code.voidsetReturnValue(java.lang.Object newValue)protected voidsetShiftKey(boolean shiftKey)Sets whetherSHIFTkey is pressed on not.voidsetSrcElement(java.lang.Object srcElement)Sets the object that fired the event.voidsetTarget(EventTarget target)Sets the event target.voidsetType(java.lang.String type)Sets the event type.voidstartFire()Called when the event starts being fired.voidstopImmediatePropagation()Prevents other listeners of the same event from being called.voidstopPropagation()Stops the event from propagating.java.lang.StringtoString()-
Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
-
-
-
-
Field Detail
-
KEY_CURRENT_EVENT
protected static final java.lang.String KEY_CURRENT_EVENT
Key to place the event's target in the Context's scope during event processing to compute node coordinates compatible with those of the event.- See Also:
- Constant Field Values
-
TYPE_SUBMIT
public static final java.lang.String TYPE_SUBMIT
The submit event type, triggered byonsubmitevent handlers.- See Also:
- Constant Field Values
-
TYPE_CHANGE
public static final java.lang.String TYPE_CHANGE
The change event type, triggered byonchangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_LOAD
public static final java.lang.String TYPE_LOAD
The load event type, triggered byonloadevent handlers.- See Also:
- Constant Field Values
-
TYPE_UNLOAD
public static final java.lang.String TYPE_UNLOAD
The unload event type, triggered byonunloadevent handlers.- See Also:
- Constant Field Values
-
TYPE_POPSTATE
public static final java.lang.String TYPE_POPSTATE
The popstate event type, triggered byonpopstateevent handlers.- See Also:
- Constant Field Values
-
TYPE_FOCUS
public static final java.lang.String TYPE_FOCUS
The focus event type, triggered byonfocusevent handlers.- See Also:
- Constant Field Values
-
TYPE_FOCUS_IN
public static final java.lang.String TYPE_FOCUS_IN
The focus in event type, triggered byonfocusinevent handlers.- See Also:
- Constant Field Values
-
TYPE_FOCUS_OUT
public static final java.lang.String TYPE_FOCUS_OUT
The focus out event type, triggered byonfocusoutevent handlers.- See Also:
- Constant Field Values
-
TYPE_BLUR
public static final java.lang.String TYPE_BLUR
The blur event type, triggered byonblurevent handlers.- See Also:
- Constant Field Values
-
TYPE_KEY_DOWN
public static final java.lang.String TYPE_KEY_DOWN
The key down event type, triggered byonkeydownevent handlers.- See Also:
- Constant Field Values
-
TYPE_KEY_PRESS
public static final java.lang.String TYPE_KEY_PRESS
The key down event type, triggered byonkeypressevent handlers.- See Also:
- Constant Field Values
-
TYPE_INPUT
public static final java.lang.String TYPE_INPUT
The input event type, triggered byoninputevent handlers.- See Also:
- Constant Field Values
-
TYPE_KEY_UP
public static final java.lang.String TYPE_KEY_UP
The key down event type, triggered byonkeyupevent handlers.- See Also:
- Constant Field Values
-
TYPE_RESET
public static final java.lang.String TYPE_RESET
The submit event type, triggered byonresetevent handlers.- See Also:
- Constant Field Values
-
TYPE_BEFORE_UNLOAD
public static final java.lang.String TYPE_BEFORE_UNLOAD
The beforeunload event type, triggered byonbeforeunloadevent handlers.- See Also:
- Constant Field Values
-
TYPE_DOM_DOCUMENT_LOADED
public static final java.lang.String TYPE_DOM_DOCUMENT_LOADED
Triggered after the DOM has loaded but before images etc.- See Also:
- Constant Field Values
-
TYPE_PROPERTY_CHANGE
public static final java.lang.String TYPE_PROPERTY_CHANGE
The event type triggered byonpropertychangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_HASH_CHANGE
public static final java.lang.String TYPE_HASH_CHANGE
The event type triggered byonhashchangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_READY_STATE_CHANGE
public static final java.lang.String TYPE_READY_STATE_CHANGE
The event type triggered byonreadystatechangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_ERROR
public static final java.lang.String TYPE_ERROR
The event type triggered byonerrorevent handlers.- See Also:
- Constant Field Values
-
TYPE_MESSAGE
public static final java.lang.String TYPE_MESSAGE
The message event type, triggered by postMessage.- See Also:
- Constant Field Values
-
TYPE_CLOSE
public static final java.lang.String TYPE_CLOSE
The close event type, triggered byoncloseevent handlers.- See Also:
- Constant Field Values
-
TYPE_OPEN
public static final java.lang.String TYPE_OPEN
The open event type, triggered byonopenevent handlers.- See Also:
- Constant Field Values
-
TYPE_LOAD_START
public static final java.lang.String TYPE_LOAD_START
The load start event type, triggered byonloadstartevent handlers.- See Also:
- Constant Field Values
-
TYPE_LOAD_END
public static final java.lang.String TYPE_LOAD_END
The load end event type, triggered byonloadendevent handlers.- See Also:
- Constant Field Values
-
TYPE_PROGRESS
public static final java.lang.String TYPE_PROGRESS
The progress event type, triggered byonprogressevent handlers.- See Also:
- Constant Field Values
-
TYPE_ABORT
public static final java.lang.String TYPE_ABORT
The abort event type, triggered byonabortevent handlers.- See Also:
- Constant Field Values
-
TYPE_TIMEOUT
public static final java.lang.String TYPE_TIMEOUT
The timeout event type, triggered byontimeoutevent handlers.- See Also:
- Constant Field Values
-
TYPE_SCROLL
public static final java.lang.String TYPE_SCROLL
The scroll event type, triggered byonscrollevent handlers.- See Also:
- Constant Field Values
-
TYPE_SCROLLEND
public static final java.lang.String TYPE_SCROLLEND
The scroll event type, triggered byonscrollendevent handlers.- See Also:
- Constant Field Values
-
TYPE_SEARCH
public static final java.lang.String TYPE_SEARCH
The search event type, triggered byonsearchevent handlers.- See Also:
- Constant Field Values
-
TYPE_DRAGEND
public static final java.lang.String TYPE_DRAGEND
The dragend event type, triggered bydragendevent handlers.- See Also:
- Constant Field Values
-
TYPE_INVALID
public static final java.lang.String TYPE_INVALID
The invalid event type, triggered byinvalidevent handlers.- See Also:
- Constant Field Values
-
TYPE_POINTEROUT
public static final java.lang.String TYPE_POINTEROUT
The pointerout event type, triggered bypointeroutevent handlers.- See Also:
- Constant Field Values
-
TYPE_RATECHANGE
public static final java.lang.String TYPE_RATECHANGE
The ratechange event type, triggered byratechangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_ANIMATIONITERATION
public static final java.lang.String TYPE_ANIMATIONITERATION
The animationiteration event type, triggered byanimationiterationevent handlers.- See Also:
- Constant Field Values
-
TYPE_CANPLAYTHROUGH
public static final java.lang.String TYPE_CANPLAYTHROUGH
The canplaythrough event type, triggered bycanplaythroughevent handlers.- See Also:
- Constant Field Values
-
TYPE_CANCEL
public static final java.lang.String TYPE_CANCEL
The cancel event type, triggered bycancelevent handlers.- See Also:
- Constant Field Values
-
TYPE_POINTERENTER
public static final java.lang.String TYPE_POINTERENTER
The pointerenter event type, triggered bypointerenterevent handlers.- See Also:
- Constant Field Values
-
TYPE_SELECT
public static final java.lang.String TYPE_SELECT
The select event type, triggered byselectevent handlers.- See Also:
- Constant Field Values
-
TYPE_AUXCLICK
public static final java.lang.String TYPE_AUXCLICK
The auxclick event type, triggered byauxclickevent handlers.- See Also:
- Constant Field Values
-
TYPE_WEBANIMATIONSTART
public static final java.lang.String TYPE_WEBANIMATIONSTART
The webkitanimationstart event type, triggered bywebkitanimationstartevent handlers.- See Also:
- Constant Field Values
-
TYPE_DRAG
public static final java.lang.String TYPE_DRAG
The drag event type, triggered bydragevent handlers.- See Also:
- Constant Field Values
-
TYPE_SEEKED
public static final java.lang.String TYPE_SEEKED
The seeked event type, triggered byseekedevent handlers.- See Also:
- Constant Field Values
-
TYPE_OFFLINE
public static final java.lang.String TYPE_OFFLINE
The offline event type, triggered byofflineevent handlers.- See Also:
- Constant Field Values
-
TYPE_DEVICEORIENTATION
public static final java.lang.String TYPE_DEVICEORIENTATION
The deviceorientation event type, triggered bydeviceorientationevent handlers.- See Also:
- Constant Field Values
-
TYPE_TOGGLE
public static final java.lang.String TYPE_TOGGLE
The toggle event type, triggered bytoggleevent handlers.- See Also:
- Constant Field Values
-
TYPE_PLAY
public static final java.lang.String TYPE_PLAY
The play event type, triggered byplayevent handlers.- See Also:
- Constant Field Values
-
TYPE_LOADEDMETADATA
public static final java.lang.String TYPE_LOADEDMETADATA
The loadedmetadata event type, triggered byloadedmetadataevent handlers.- See Also:
- Constant Field Values
-
TYPE_POINTERMOVE
public static final java.lang.String TYPE_POINTERMOVE
The pointermove event type, triggered bypointermoveevent handlers.- See Also:
- Constant Field Values
-
TYPE_LOSTPOINTERCAPTURE
public static final java.lang.String TYPE_LOSTPOINTERCAPTURE
The lostpointercapture event type, triggered bylostpointercaptureevent handlers.- See Also:
- Constant Field Values
-
TYPE_POINTEROVER
public static final java.lang.String TYPE_POINTEROVER
The pointerover event type, triggered bypointeroverevent handlers.- See Also:
- Constant Field Values
-
TYPE_ANIMATIONCANCEL
public static final java.lang.String TYPE_ANIMATIONCANCEL
The animationcancel event type, triggered byanimationcancelevent handlers.- See Also:
- Constant Field Values
-
TYPE_ANIMATIONEND
public static final java.lang.String TYPE_ANIMATIONEND
The animationend event type, triggered byanimationendevent handlers.- See Also:
- Constant Field Values
-
TYPE_DRAGENTER
public static final java.lang.String TYPE_DRAGENTER
The dragenter event type, triggered bydragenterevent handlers.- See Also:
- Constant Field Values
-
TYPE_AFTERPRINT
public static final java.lang.String TYPE_AFTERPRINT
The afterprint event type, triggered byafterprintevent handlers.- See Also:
- Constant Field Values
-
TYPE_MOZFULLSCREENERROR
public static final java.lang.String TYPE_MOZFULLSCREENERROR
The mozfullscreenerror event type, triggered bymozfullscreenerrorevent handlers.- See Also:
- Constant Field Values
-
TYPE_MOUSELEAVE
public static final java.lang.String TYPE_MOUSELEAVE
The mouseleave event type, triggered bymouseleaveevent handlers.- See Also:
- Constant Field Values
-
TYPE_MOUSEWHEEL
public static final java.lang.String TYPE_MOUSEWHEEL
The mousewheel event type, triggered bymousewheelevent handlers.- See Also:
- Constant Field Values
-
TYPE_SEEKING
public static final java.lang.String TYPE_SEEKING
The seeking event type, triggered byseekingevent handlers.- See Also:
- Constant Field Values
-
TYPE_CUECHANGE
public static final java.lang.String TYPE_CUECHANGE
The cuechange event type, triggered bycuechangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_PAGESHOW
public static final java.lang.String TYPE_PAGESHOW
The pageshow event type, triggered bypageshowevent handlers.- See Also:
- Constant Field Values
-
TYPE_MOZFULLSCREENCHANGE
public static final java.lang.String TYPE_MOZFULLSCREENCHANGE
The mozfullscreenchange event type, triggered bymozfullscreenchangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_DURATIONCHANGE
public static final java.lang.String TYPE_DURATIONCHANGE
The durationchange event type, triggered bydurationchangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_PLAYING
public static final java.lang.String TYPE_PLAYING
The playing event type, triggered byplayingevent handlers.- See Also:
- Constant Field Values
-
TYPE_ENDED
public static final java.lang.String TYPE_ENDED
The ended event type, triggered byendedevent handlers.- See Also:
- Constant Field Values
-
TYPE_LOADEDDATA
public static final java.lang.String TYPE_LOADEDDATA
The loadeddata event type, triggered byloadeddataevent handlers.- See Also:
- Constant Field Values
-
TYPE_UNHANDLEDREJECTION
public static final java.lang.String TYPE_UNHANDLEDREJECTION
The unhandledrejection event type, triggered byunhandledrejectionevent handlers.- See Also:
- Constant Field Values
-
TYPE_SUSPEND
public static final java.lang.String TYPE_SUSPEND
The suspend event type, triggered bysuspendevent handlers.- See Also:
- Constant Field Values
-
TYPE_WAITING
public static final java.lang.String TYPE_WAITING
The waiting event type, triggered bywaitingevent handlers.- See Also:
- Constant Field Values
-
TYPE_CANPLAY
public static final java.lang.String TYPE_CANPLAY
The canplay event type, triggered bycanplayevent handlers.- See Also:
- Constant Field Values
-
TYPE_LANGUAGECHANGE
public static final java.lang.String TYPE_LANGUAGECHANGE
The languagechange event type, triggered bylanguagechangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_EMPTIED
public static final java.lang.String TYPE_EMPTIED
The emptied event type, triggered byemptiedevent handlers.- See Also:
- Constant Field Values
-
TYPE_REJECTIONHANDLED
public static final java.lang.String TYPE_REJECTIONHANDLED
The rejectionhandled event type, triggered byrejectionhandledevent handlers.- See Also:
- Constant Field Values
-
TYPE_POINTERCANCEL
public static final java.lang.String TYPE_POINTERCANCEL
The pointercancel event type, triggered bypointercancelevent handlers.- See Also:
- Constant Field Values
-
TYPE_RESIZE
public static final java.lang.String TYPE_RESIZE
The resize event type, triggered byresizeevent handlers.- See Also:
- Constant Field Values
-
TYPE_PAUSE
public static final java.lang.String TYPE_PAUSE
The pause event type, triggered bypauseevent handlers.- See Also:
- Constant Field Values
-
TYPE_POINTERUP
public static final java.lang.String TYPE_POINTERUP
The pointerup event type, triggered bypointerupevent handlers.- See Also:
- Constant Field Values
-
TYPE_WHEEL
public static final java.lang.String TYPE_WHEEL
The wheel event type, triggered bywheelevent handlers.- See Also:
- Constant Field Values
-
TYPE_POINTERLEAVE
public static final java.lang.String TYPE_POINTERLEAVE
The pointerleave event type, triggered bypointerleaveevent handlers.- See Also:
- Constant Field Values
-
TYPE_BEFOREPRINT
public static final java.lang.String TYPE_BEFOREPRINT
The beforeprint event type, triggered bybeforeprintevent handlers.- See Also:
- Constant Field Values
-
TYPE_STORAGE
public static final java.lang.String TYPE_STORAGE
The storage event type, triggered bystorageevent handlers.- See Also:
- Constant Field Values
-
TYPE_ANIMATIONSTART
public static final java.lang.String TYPE_ANIMATIONSTART
The animationstart event type, triggered byanimationstartevent handlers.- See Also:
- Constant Field Values
-
TYPE_TIMEUPDATE
public static final java.lang.String TYPE_TIMEUPDATE
The timeupdate event type, triggered bytimeupdateevent handlers.- See Also:
- Constant Field Values
-
TYPE_PAGEHIDE
public static final java.lang.String TYPE_PAGEHIDE
The pagehide event type, triggered bypagehideevent handlers.- See Also:
- Constant Field Values
-
TYPE_WEBKITANIMATIONITERATION
public static final java.lang.String TYPE_WEBKITANIMATIONITERATION
The webkitanimationiteration event type, triggered bywebkitanimationiterationevent handlers.- See Also:
- Constant Field Values
-
TYPE_DRAGOVER
public static final java.lang.String TYPE_DRAGOVER
The dragover event type, triggered bydragoverevent handlers.- See Also:
- Constant Field Values
-
TYPE_ONLINE
public static final java.lang.String TYPE_ONLINE
The online event type, triggered byonlineevent handlers.- See Also:
- Constant Field Values
-
TYPE_VOLUMECHANGE
public static final java.lang.String TYPE_VOLUMECHANGE
The volumechange event type, triggered byvolumechangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_GOTPOINTERCAPTURE
public static final java.lang.String TYPE_GOTPOINTERCAPTURE
The gotpointercapture event type, triggered bygotpointercaptureevent handlers.- See Also:
- Constant Field Values
-
TYPE_WEBKITTRANSITIONEND
public static final java.lang.String TYPE_WEBKITTRANSITIONEND
The webkittransitionend event type, triggered bywebkittransitionendevent handlers.- See Also:
- Constant Field Values
-
TYPE_WEBKITANIMATIONEND
public static final java.lang.String TYPE_WEBKITANIMATIONEND
The webkitanimationend event type, triggered bywebkitanimationendevent handlers.- See Also:
- Constant Field Values
-
TYPE_DEVICEMOTION
public static final java.lang.String TYPE_DEVICEMOTION
The devicemotion event type, triggered bydevicemotionevent handlers.- See Also:
- Constant Field Values
-
TYPE_STALLED
public static final java.lang.String TYPE_STALLED
The stalled event type, triggered bystalledevent handlers.- See Also:
- Constant Field Values
-
TYPE_MOUDEENTER
public static final java.lang.String TYPE_MOUDEENTER
The mouseenter event type, triggered bymouseenterevent handlers.- See Also:
- Constant Field Values
-
TYPE_DRAGLEAVE
public static final java.lang.String TYPE_DRAGLEAVE
The dragleave event type, triggered bydragleaveevent handlers.- See Also:
- Constant Field Values
-
TYPE_POINTERDOWN
public static final java.lang.String TYPE_POINTERDOWN
The pointerdown event type, triggered bypointerdownevent handlers.- See Also:
- Constant Field Values
-
TYPE_DROP
public static final java.lang.String TYPE_DROP
The drop event type, triggered bydropevent handlers.- See Also:
- Constant Field Values
-
TYPE_DRAGSTART
public static final java.lang.String TYPE_DRAGSTART
The dragstart event type, triggered bydragstartevent handlers.- See Also:
- Constant Field Values
-
TYPE_TRANSITIONEND
public static final java.lang.String TYPE_TRANSITIONEND
The transitionend event type, triggered bytransitionendevent handlers.- See Also:
- Constant Field Values
-
TYPE_DEVICEORIENTATIONABSOLUTE
public static final java.lang.String TYPE_DEVICEORIENTATIONABSOLUTE
The deviceorientationabsolute event type, triggered bydeviceorientationabsoluteevent handlers.- See Also:
- Constant Field Values
-
TYPE_BEFORECOPY
public static final java.lang.String TYPE_BEFORECOPY
The beforecopy event type, triggered bybeforecopyevent handlers.- See Also:
- Constant Field Values
-
TYPE_BEFORECUT
public static final java.lang.String TYPE_BEFORECUT
The beforecut event type, triggered bybeforecutevent handlers.- See Also:
- Constant Field Values
-
TYPE_BEFOREPASTE
public static final java.lang.String TYPE_BEFOREPASTE
The beforepaste event type, triggered bybeforepasteevent handlers.- See Also:
- Constant Field Values
-
TYPE_SELECTSTART
public static final java.lang.String TYPE_SELECTSTART
The selectstart event type, triggered byselectstartevent handlers.- See Also:
- Constant Field Values
-
TYPE_WEBKITFULLSCREENCHANGE
public static final java.lang.String TYPE_WEBKITFULLSCREENCHANGE
The webkitfullscreenchange event type, triggered bywebkitfullscreenchangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_WEBKITFULLSCREENERROR
public static final java.lang.String TYPE_WEBKITFULLSCREENERROR
The webkitfullscreenerror event type, triggered bywebkitfullscreenerrorevent handlers.- See Also:
- Constant Field Values
-
TYPE_COPY
public static final java.lang.String TYPE_COPY
The copy event type, triggered bycopyevent handlers.- See Also:
- Constant Field Values
-
TYPE_CUT
public static final java.lang.String TYPE_CUT
The cut event type, triggered bycutevent handlers.- See Also:
- Constant Field Values
-
TYPE_PASTE
public static final java.lang.String TYPE_PASTE
The paste event type, triggered bypasteevent handlers.- See Also:
- Constant Field Values
-
TYPE_ONMESSAGEERROR
public static final java.lang.String TYPE_ONMESSAGEERROR
The onmessageerror event type, triggered byonmessageerrorevent handlers.- See Also:
- Constant Field Values
-
TYPE_POINTERLOCKCHANGE
public static final java.lang.String TYPE_POINTERLOCKCHANGE
The pointerlockchange event type, triggered bypointerlockchangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_POINTERLOCKERROR
public static final java.lang.String TYPE_POINTERLOCKERROR
The pointerlockerror event type, triggered bypointerlockerrorevent handlers.- See Also:
- Constant Field Values
-
TYPE_SELECTIONCHANGE
public static final java.lang.String TYPE_SELECTIONCHANGE
The selectionchange event type, triggered byselectionchangeevent handlers.- See Also:
- Constant Field Values
-
TYPE_AFTERSCRIPTEXECUTE
public static final java.lang.String TYPE_AFTERSCRIPTEXECUTE
The afterscriptexecute event type, triggered byafterscriptexecuteevent handlers.- See Also:
- Constant Field Values
-
TYPE_BEFORESCRIPTEXECUTE
public static final java.lang.String TYPE_BEFORESCRIPTEXECUTE
The beforescriptexecute event type, triggered bybeforescriptexecuteevent handlers.- See Also:
- Constant Field Values
-
TYPE_ONTRANSITIONCANCEL
public static final java.lang.String TYPE_ONTRANSITIONCANCEL
The ontransitioncancel event type, triggered byontransitioncancelevent handlers.- See Also:
- Constant Field Values
-
TYPE_ONTRANSITIONEND
public static final java.lang.String TYPE_ONTRANSITIONEND
The ontransitionend event type, triggered byontransitionendevent handlers.- See Also:
- Constant Field Values
-
TYPE_ONTRANSITIONRUN
public static final java.lang.String TYPE_ONTRANSITIONRUN
The ontransitionrun event type, triggered byontransitionrunevent handlers.- See Also:
- Constant Field Values
-
TYPE_ONTRANSITIONSTART
public static final java.lang.String TYPE_ONTRANSITIONSTART
The ontransitionstart event type, triggered byontransitionstartevent handlers.- See Also:
- Constant Field Values
-
TYPE_GAMEPAD_CONNECTED
public static final java.lang.String TYPE_GAMEPAD_CONNECTED
The ongamepadconnected event type, triggered byongamepadconnectedevent handlers.- See Also:
- Constant Field Values
-
TYPE_GAMEPAD_DISCONNECTED
public static final java.lang.String TYPE_GAMEPAD_DISCONNECTED
The ongamepaddisconnected event type, triggered byongamepaddisconnectedevent handlers.- See Also:
- Constant Field Values
-
TYPE_MSSITEMODEJUMPLISTITEMREMOVED
public static final java.lang.String TYPE_MSSITEMODEJUMPLISTITEMREMOVED
The mssitemodejumplistitemremoved event type, triggered bymssitemodejumplistitemremovedevent handlers.- See Also:
- Constant Field Values
-
NONE
public static final int NONE
No event phase.- See Also:
- Constant Field Values
-
CAPTURING_PHASE
public static final int CAPTURING_PHASE
The first event phase: the capturing phase.- See Also:
- Constant Field Values
-
AT_TARGET
public static final int AT_TARGET
The second event phase: at the event target.- See Also:
- Constant Field Values
-
BUBBLING_PHASE
public static final int BUBBLING_PHASE
The third (and final) event phase: the bubbling phase.- See Also:
- Constant Field Values
-
ALT_MASK
public static final int ALT_MASK
Constant.- See Also:
- Constant Field Values
-
CONTROL_MASK
public static final int CONTROL_MASK
Constant.- See Also:
- Constant Field Values
-
SHIFT_MASK
public static final int SHIFT_MASK
Constant.- See Also:
- Constant Field Values
-
META_MASK
public static final int META_MASK
Constant.- See Also:
- Constant Field Values
-
srcElement_
private java.lang.Object srcElement_
-
target_
private EventTarget target_
-
currentTarget_
private org.htmlunit.corejs.javascript.Scriptable currentTarget_
-
type_
private java.lang.String type_
-
keyCode_
private int keyCode_
-
shiftKey_
private boolean shiftKey_
-
ctrlKey_
private boolean ctrlKey_
-
altKey_
private boolean altKey_
-
propertyName_
private java.lang.String propertyName_
-
stopPropagation_
private boolean stopPropagation_
-
stopImmediatePropagation_
private boolean stopImmediatePropagation_
-
preventDefault_
private boolean preventDefault_
-
eventPhase_
private int eventPhase_
The current event phase. This is a W3C standard attribute. One ofNONE,CAPTURING_PHASE,AT_TARGETorBUBBLING_PHASE.
-
bubbles_
private boolean bubbles_
Whether or not the event bubbles. The value of this attribute depends on the event type. To determine if a certain event type bubbles, see events Most event types do bubble, so this is true by default; event types which do not bubble should overwrite this value in their constructors.
-
cancelable_
private boolean cancelable_
Whether or not the event can be canceled. The value of this attribute depends on the event type. To determine if a certain event type can be canceled, see http://www.w3.org/TR/DOM-Level-2-Events/events.html The more common event types are cancelable, so this is true by default; event types which cannot be canceled should overwrite this value in their constructors.
-
timeStamp_
private final long timeStamp_
The time at which the event was created.
-
-
Constructor Detail
-
Event
public Event(DomNode domNode, java.lang.String type)
Creates a new event instance.- Parameters:
domNode- the DOM node that triggered the eventtype- the event type
-
Event
public Event(EventTarget target, java.lang.String type)
Creates a new event instance.- Parameters:
target- the targettype- the event type
-
Event
public Event()
Used to build the prototype.
-
-
Method Detail
-
createPropertyChangeEvent
public static Event createPropertyChangeEvent(DomNode domNode, java.lang.String propertyName)
Creates a new Event withTYPE_PROPERTY_CHANGEtype.- Parameters:
domNode- the DOM node that triggered the eventpropertyName- the property name that was changed- Returns:
- the new Event object
-
eventCreated
public void eventCreated()
Called whenever an event is created usingDocument.createEvent(..). This method is called after the parent scope was set so you are able to access the browser version.
-
jsConstructor
public void jsConstructor(java.lang.String type, org.htmlunit.corejs.javascript.ScriptableObject details)JavaScript constructor.- Parameters:
type- the event typedetails- the event details (optional)
-
startFire
public void startFire()
Called when the event starts being fired.
-
endFire
public void endFire()
Called when the event being fired ends.
-
getSrcElement
public java.lang.Object getSrcElement()
Returns the object that fired the event.- Returns:
- the object that fired the event
-
setSrcElement
public void setSrcElement(java.lang.Object srcElement)
Sets the object that fired the event.- Parameters:
srcElement- the object that fired the event
-
getTarget
public java.lang.Object getTarget()
Returns the event target to which the event was originally dispatched.- Returns:
- the event target to which the event was originally dispatched
-
setTarget
public void setTarget(EventTarget target)
Sets the event target.- Parameters:
target- the event target
-
getCurrentTarget
public org.htmlunit.corejs.javascript.Scriptable getCurrentTarget()
Returns the event target whose event listeners are currently being processed. This is useful during event capturing and event bubbling.- Returns:
- the current event target
-
setCurrentTarget
public void setCurrentTarget(org.htmlunit.corejs.javascript.Scriptable target)
Sets the current target.- Parameters:
target- the new value
-
getType
public java.lang.String getType()
Returns the event type.- Returns:
- the event type
-
setType
public void setType(java.lang.String type)
Sets the event type.- Parameters:
type- the event type
-
setEventType
public void setEventType(java.lang.String eventType)
Sets the event type.- Parameters:
eventType- the event type
-
getTimeStamp
public long getTimeStamp()
Returns the time at which this event was created.- Returns:
- the time at which this event was created
-
setKeyCode
protected void setKeyCode(int keyCode)
Sets the key code.- Parameters:
keyCode- the virtual key code value of the key which was depressed, otherwise zero
-
getKeyCode
public int getKeyCode()
Returns the key code associated with the event.- Returns:
- the key code associated with the event
-
isShiftKey
public boolean isShiftKey()
Returns whetherSHIFThas been pressed during this event or not.- Returns:
- whether
SHIFThas been pressed during this event or not
-
setShiftKey
protected void setShiftKey(boolean shiftKey)
Sets whetherSHIFTkey is pressed on not.- Parameters:
shiftKey- whetherSHIFThas been pressed during this event or not
-
isCtrlKey
public boolean isCtrlKey()
Returns whetherCTRLhas been pressed during this event or not.- Returns:
- whether
CTRLhas been pressed during this event or not
-
setCtrlKey
protected void setCtrlKey(boolean ctrlKey)
Sets whetherCTRLkey is pressed on not.- Parameters:
ctrlKey- whetherCTRLhas been pressed during this event or not
-
isAltKey
public boolean isAltKey()
Returns whetherALThas been pressed during this event or not.- Returns:
- whether
ALThas been pressed during this event or not
-
setAltKey
protected void setAltKey(boolean altKey)
Sets whetherALTkey is pressed on not.- Parameters:
altKey- whetherALThas been pressed during this event or not
-
getEventPhase
public int getEventPhase()
Returns the current event phase for the event.- Returns:
- the current event phase for the event
-
setEventPhase
public void setEventPhase(int phase)
- Parameters:
phase- the phase the event is in
-
isBubbles
public boolean isBubbles()
- Returns:
- whether or not this event bubbles
-
setBubbles
protected void setBubbles(boolean bubbles)
- Parameters:
bubbles- the bubbles to set
-
isCancelable
public boolean isCancelable()
- Returns:
- whether or not this event can be canceled
-
setCancelable
protected void setCancelable(boolean cancelable)
- Parameters:
cancelable- the cancelable to set
-
isDefaultPrevented
public boolean isDefaultPrevented()
Returnstrueif bothcancelableistrueandpreventDefault()has been called for this event. Otherwise this attribute must returnfalse.- Returns:
trueif this event has been cancelled or not
-
isCancelBubble
public boolean isCancelBubble()
- Returns:
- indicates if event propagation is stopped
-
setCancelBubble
public void setCancelBubble(boolean newValue)
- Parameters:
newValue- indicates if event propagation is stopped
-
stopPropagation
public void stopPropagation()
Stops the event from propagating.
-
isPropagationStopped
public boolean isPropagationStopped()
Indicates if event propagation is stopped.- Returns:
- the status
-
stopImmediatePropagation
public void stopImmediatePropagation()
Prevents other listeners of the same event from being called.
-
isImmediatePropagationStopped
public boolean isImmediatePropagationStopped()
Indicates if event immediate propagation is stopped.- Returns:
- the status
-
handlePropertyHandlerReturnValue
void handlePropertyHandlerReturnValue(java.lang.Object returnValue)
Handles the return values of property handlers.- Parameters:
returnValue- the return value returned by the property handler
-
getPropertyName
public java.lang.String getPropertyName()
Returns the property name associated with the event.- Returns:
- the property name associated with the event
-
initEvent
public void initEvent(java.lang.String type, boolean bubbles, boolean cancelable)Initializes this event.- Parameters:
type- the event typebubbles- whether or not the event should bubblecancelable- whether or not the event the event should be cancelable
-
preventDefault
public void preventDefault()
If, during any stage of event flow, this method is called the event is canceled. Any default action associated with the event will not occur. Calling this method for a non-cancelable event has no effect.
-
isAborted
public boolean isAborted(ScriptResult result)
Returnstrueif this event has been aborted viapreventDefault()in standards-compliant browsers.- Parameters:
result- the event handler result (iffalse, the event is considered aborted)- Returns:
trueif this event has been aborted
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
processLabelAfterBubbling
public boolean processLabelAfterBubbling()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
If we click on a label, we have to simulate a click on the element referenced by the 'for' attribute also. To support this for special events we have this method here.- Returns:
- false in this default impl
-
getReturnValue
public java.lang.Object getReturnValue()
- Returns:
- the return value property
-
setReturnValue
public void setReturnValue(java.lang.Object newValue)
- Parameters:
newValue- the new return value
-
getComposed
public java.lang.Object getComposed()
- Returns:
- the return composed property
-
isMissingOrUndefined
protected static boolean isMissingOrUndefined(java.lang.Object value)
Returns whether the given value indicates a missing or undefined property.- Parameters:
value- the new value- Returns:
- whether the given value indicates a missing or undefined property
-
-