Class Event
java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.event.Event
- All Implemented Interfaces:
Serializable,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
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant.private booleanstatic final intThe second event phase: at the event target.private booleanWhether or not the event bubbles.static final intThe third (and final) event phase: the bubbling phase.private booleanWhether or not the event can be canceled.static final intThe first event phase: the capturing phase.static final intConstant.private booleanprivate org.htmlunit.corejs.javascript.Scriptableprivate intThe current event phase.protected static final StringKey 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 intstatic final intConstant.static final intNo event phase.private booleanprivate Stringstatic final intConstant.private booleanprivate Objectprivate booleanprivate booleanprivate EventTargetprivate final longThe time at which the event was created.private Stringstatic final StringThe abort event type, triggered byonabortevent handlers.static final StringThe afterprint event type, triggered byafterprintevent handlers.static final StringThe afterscriptexecute event type, triggered byafterscriptexecuteevent handlers.static final StringThe animationcancel event type, triggered byanimationcancelevent handlers.static final StringThe animationend event type, triggered byanimationendevent handlers.static final StringThe animationiteration event type, triggered byanimationiterationevent handlers.static final StringThe animationstart event type, triggered byanimationstartevent handlers.static final StringThe auxclick event type, triggered byauxclickevent handlers.static final StringThe beforeunload event type, triggered byonbeforeunloadevent handlers.static final StringThe beforecopy event type, triggered bybeforecopyevent handlers.static final StringThe beforecut event type, triggered bybeforecutevent handlers.static final StringThe beforepaste event type, triggered bybeforepasteevent handlers.static final StringThe beforeprint event type, triggered bybeforeprintevent handlers.static final StringThe beforescriptexecute event type, triggered bybeforescriptexecuteevent handlers.static final StringThe blur event type, triggered byonblurevent handlers.static final StringThe cancel event type, triggered bycancelevent handlers.static final StringThe canplay event type, triggered bycanplayevent handlers.static final StringThe canplaythrough event type, triggered bycanplaythroughevent handlers.static final StringThe change event type, triggered byonchangeevent handlers.static final StringThe close event type, triggered byoncloseevent handlers.static final StringThe copy event type, triggered bycopyevent handlers.static final StringThe cuechange event type, triggered bycuechangeevent handlers.static final StringThe cut event type, triggered bycutevent handlers.static final StringThe devicemotion event type, triggered bydevicemotionevent handlers.static final StringThe deviceorientation event type, triggered bydeviceorientationevent handlers.static final StringThe deviceorientationabsolute event type, triggered bydeviceorientationabsoluteevent handlers.static final StringTriggered after the DOM has loaded but before images etc.static final StringThe drag event type, triggered bydragevent handlers.static final StringThe dragend event type, triggered bydragendevent handlers.static final StringThe dragenter event type, triggered bydragenterevent handlers.static final StringThe dragleave event type, triggered bydragleaveevent handlers.static final StringThe dragover event type, triggered bydragoverevent handlers.static final StringThe dragstart event type, triggered bydragstartevent handlers.static final StringThe drop event type, triggered bydropevent handlers.static final StringThe durationchange event type, triggered bydurationchangeevent handlers.static final StringThe emptied event type, triggered byemptiedevent handlers.static final StringThe ended event type, triggered byendedevent handlers.static final StringThe event type triggered byonerrorevent handlers.static final StringThe focus event type, triggered byonfocusevent handlers.static final StringThe focus in event type, triggered byonfocusinevent handlers.static final StringThe focus out event type, triggered byonfocusoutevent handlers.static final StringThe ongamepadconnected event type, triggered byongamepadconnectedevent handlers.static final StringThe ongamepaddisconnected event type, triggered byongamepaddisconnectedevent handlers.static final StringThe gotpointercapture event type, triggered bygotpointercaptureevent handlers.static final StringThe event type triggered byonhashchangeevent handlers.static final StringThe input event type, triggered byoninputevent handlers.static final StringThe invalid event type, triggered byinvalidevent handlers.static final StringThe key down event type, triggered byonkeydownevent handlers.static final StringThe key down event type, triggered byonkeypressevent handlers.static final StringThe key down event type, triggered byonkeyupevent handlers.static final StringThe languagechange event type, triggered bylanguagechangeevent handlers.static final StringThe load event type, triggered byonloadevent handlers.static final StringThe load end event type, triggered byonloadendevent handlers.static final StringThe load start event type, triggered byonloadstartevent handlers.static final StringThe loadeddata event type, triggered byloadeddataevent handlers.static final StringThe loadedmetadata event type, triggered byloadedmetadataevent handlers.static final StringThe lostpointercapture event type, triggered bylostpointercaptureevent handlers.static final StringThe message event type, triggered by postMessage.static final StringThe mouseenter event type, triggered bymouseenterevent handlers.static final StringThe mouseleave event type, triggered bymouseleaveevent handlers.static final StringThe mousewheel event type, triggered bymousewheelevent handlers.static final StringThe mozfullscreenchange event type, triggered bymozfullscreenchangeevent handlers.static final StringThe mozfullscreenerror event type, triggered bymozfullscreenerrorevent handlers.static final StringThe mssitemodejumplistitemremoved event type, triggered bymssitemodejumplistitemremovedevent handlers.static final StringThe offline event type, triggered byofflineevent handlers.static final StringThe online event type, triggered byonlineevent handlers.static final StringThe onmessageerror event type, triggered byonmessageerrorevent handlers.static final StringThe ontransitioncancel event type, triggered byontransitioncancelevent handlers.static final StringThe ontransitionend event type, triggered byontransitionendevent handlers.static final StringThe ontransitionrun event type, triggered byontransitionrunevent handlers.static final StringThe ontransitionstart event type, triggered byontransitionstartevent handlers.static final StringThe open event type, triggered byonopenevent handlers.static final StringThe pagehide event type, triggered bypagehideevent handlers.static final StringThe pageshow event type, triggered bypageshowevent handlers.static final StringThe paste event type, triggered bypasteevent handlers.static final StringThe pause event type, triggered bypauseevent handlers.static final StringThe play event type, triggered byplayevent handlers.static final StringThe playing event type, triggered byplayingevent handlers.static final StringThe pointercancel event type, triggered bypointercancelevent handlers.static final StringThe pointerdown event type, triggered bypointerdownevent handlers.static final StringThe pointerenter event type, triggered bypointerenterevent handlers.static final StringThe pointerleave event type, triggered bypointerleaveevent handlers.static final StringThe pointerlockchange event type, triggered bypointerlockchangeevent handlers.static final StringThe pointerlockerror event type, triggered bypointerlockerrorevent handlers.static final StringThe pointermove event type, triggered bypointermoveevent handlers.static final StringThe pointerout event type, triggered bypointeroutevent handlers.static final StringThe pointerover event type, triggered bypointeroverevent handlers.static final StringThe pointerup event type, triggered bypointerupevent handlers.static final StringThe popstate event type, triggered byonpopstateevent handlers.static final StringThe progress event type, triggered byonprogressevent handlers.static final StringThe event type triggered byonpropertychangeevent handlers.static final StringThe ratechange event type, triggered byratechangeevent handlers.static final StringThe event type triggered byonreadystatechangeevent handlers.static final StringThe rejectionhandled event type, triggered byrejectionhandledevent handlers.static final StringThe submit event type, triggered byonresetevent handlers.static final StringThe resize event type, triggered byresizeevent handlers.static final StringThe scroll event type, triggered byonscrollevent handlers.static final StringThe scroll event type, triggered byonscrollendevent handlers.static final StringThe search event type, triggered byonsearchevent handlers.static final StringThe seeked event type, triggered byseekedevent handlers.static final StringThe seeking event type, triggered byseekingevent handlers.static final StringThe select event type, triggered byselectevent handlers.static final StringThe selectionchange event type, triggered byselectionchangeevent handlers.static final StringThe selectstart event type, triggered byselectstartevent handlers.static final StringThe stalled event type, triggered bystalledevent handlers.static final StringThe storage event type, triggered bystorageevent handlers.static final StringThe submit event type, triggered byonsubmitevent handlers.static final StringThe suspend event type, triggered bysuspendevent handlers.static final StringThe timeout event type, triggered byontimeoutevent handlers.static final StringThe timeupdate event type, triggered bytimeupdateevent handlers.static final StringThe toggle event type, triggered bytoggleevent handlers.static final StringThe transitionend event type, triggered bytransitionendevent handlers.static final StringThe unhandledrejection event type, triggered byunhandledrejectionevent handlers.static final StringThe unload event type, triggered byonunloadevent handlers.static final StringThe volumechange event type, triggered byvolumechangeevent handlers.static final StringThe waiting event type, triggered bywaitingevent handlers.static final StringThe webkitanimationstart event type, triggered bywebkitanimationstartevent handlers.static final StringThe webkitanimationend event type, triggered bywebkitanimationendevent handlers.static final StringThe webkitanimationiteration event type, triggered bywebkitanimationiterationevent handlers.static final StringThe webkitfullscreenchange event type, triggered bywebkitfullscreenchangeevent handlers.static final StringThe webkitfullscreenerror event type, triggered bywebkitfullscreenerrorevent handlers.static final StringThe webkittransitionend event type, triggered bywebkittransitionendevent handlers.static final StringThe wheel event type, triggered bywheelevent handlers.Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EventcreatePropertyChangeEvent(DomNode domNode, String propertyName) Creates a new Event withTYPE_PROPERTY_CHANGEtype.voidendFire()Called when the event being fired ends.voidCalled whenever an event is created usingDocument.createEvent(..).org.htmlunit.corejs.javascript.ScriptableReturns the event target whose event listeners are currently being processed.intReturns the current event phase for the event.intReturns the key code associated with the event.Returns the property name associated with the event.Returns the object that fired the event.Returns the event target to which the event was originally dispatched.longReturns the time at which this event was created.getType()Returns the event type.(package private) voidhandlePropertyHandlerReturnValue(Object returnValue) Handles the return values of property handlers.voidInitializes 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.booleanbooleanbooleanbooleanReturns whetherCTRLhas been pressed during this event or not.booleanReturnstrueif bothcancelableistrueandpreventDefault()has been called for this event.booleanIndicates if event immediate propagation is stopped.protected static booleanisMissingOrUndefined(Object value) Returns whether the given value indicates a missing or undefined property.booleanIndicates if event propagation is stopped.booleanReturns whetherSHIFThas been pressed during this event or not.voidjsConstructor(String type, org.htmlunit.corejs.javascript.ScriptableObject details) JavaScript constructor.voidIf, during any stage of event flow, this method is called the event is canceled.booleanINTERNAL 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(String eventType) Sets the event type.protected voidsetKeyCode(int keyCode) Sets the key code.voidsetReturnValue(Object newValue) protected voidsetShiftKey(boolean shiftKey) Sets whetherSHIFTkey is pressed on not.voidsetSrcElement(Object srcElement) Sets the object that fired the event.voidsetTarget(EventTarget target) Sets the event target.voidSets the event type.voidCalled when the event starts being fired.voidPrevents other listeners of the same event from being called.voidStops the event from propagating.toString()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, setupRejectedPromiseMethods 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 Details
-
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:
-
TYPE_SUBMIT
The submit event type, triggered byonsubmitevent handlers.- See Also:
-
TYPE_CHANGE
The change event type, triggered byonchangeevent handlers.- See Also:
-
TYPE_LOAD
The load event type, triggered byonloadevent handlers.- See Also:
-
TYPE_UNLOAD
The unload event type, triggered byonunloadevent handlers.- See Also:
-
TYPE_POPSTATE
The popstate event type, triggered byonpopstateevent handlers.- See Also:
-
TYPE_FOCUS
The focus event type, triggered byonfocusevent handlers.- See Also:
-
TYPE_FOCUS_IN
The focus in event type, triggered byonfocusinevent handlers.- See Also:
-
TYPE_FOCUS_OUT
The focus out event type, triggered byonfocusoutevent handlers.- See Also:
-
TYPE_BLUR
The blur event type, triggered byonblurevent handlers.- See Also:
-
TYPE_KEY_DOWN
The key down event type, triggered byonkeydownevent handlers.- See Also:
-
TYPE_KEY_PRESS
The key down event type, triggered byonkeypressevent handlers.- See Also:
-
TYPE_INPUT
The input event type, triggered byoninputevent handlers.- See Also:
-
TYPE_KEY_UP
The key down event type, triggered byonkeyupevent handlers.- See Also:
-
TYPE_RESET
The submit event type, triggered byonresetevent handlers.- See Also:
-
TYPE_BEFORE_UNLOAD
The beforeunload event type, triggered byonbeforeunloadevent handlers.- See Also:
-
TYPE_DOM_DOCUMENT_LOADED
Triggered after the DOM has loaded but before images etc.- See Also:
-
TYPE_PROPERTY_CHANGE
The event type triggered byonpropertychangeevent handlers.- See Also:
-
TYPE_HASH_CHANGE
The event type triggered byonhashchangeevent handlers.- See Also:
-
TYPE_READY_STATE_CHANGE
The event type triggered byonreadystatechangeevent handlers.- See Also:
-
TYPE_ERROR
The event type triggered byonerrorevent handlers.- See Also:
-
TYPE_MESSAGE
The message event type, triggered by postMessage.- See Also:
-
TYPE_CLOSE
The close event type, triggered byoncloseevent handlers.- See Also:
-
TYPE_OPEN
The open event type, triggered byonopenevent handlers.- See Also:
-
TYPE_LOAD_START
The load start event type, triggered byonloadstartevent handlers.- See Also:
-
TYPE_LOAD_END
The load end event type, triggered byonloadendevent handlers.- See Also:
-
TYPE_PROGRESS
The progress event type, triggered byonprogressevent handlers.- See Also:
-
TYPE_ABORT
The abort event type, triggered byonabortevent handlers.- See Also:
-
TYPE_TIMEOUT
The timeout event type, triggered byontimeoutevent handlers.- See Also:
-
TYPE_SCROLL
The scroll event type, triggered byonscrollevent handlers.- See Also:
-
TYPE_SCROLLEND
The scroll event type, triggered byonscrollendevent handlers.- See Also:
-
TYPE_SEARCH
The search event type, triggered byonsearchevent handlers.- See Also:
-
TYPE_DRAGEND
The dragend event type, triggered bydragendevent handlers.- See Also:
-
TYPE_INVALID
The invalid event type, triggered byinvalidevent handlers.- See Also:
-
TYPE_POINTEROUT
The pointerout event type, triggered bypointeroutevent handlers.- See Also:
-
TYPE_RATECHANGE
The ratechange event type, triggered byratechangeevent handlers.- See Also:
-
TYPE_ANIMATIONITERATION
The animationiteration event type, triggered byanimationiterationevent handlers.- See Also:
-
TYPE_CANPLAYTHROUGH
The canplaythrough event type, triggered bycanplaythroughevent handlers.- See Also:
-
TYPE_CANCEL
The cancel event type, triggered bycancelevent handlers.- See Also:
-
TYPE_POINTERENTER
The pointerenter event type, triggered bypointerenterevent handlers.- See Also:
-
TYPE_SELECT
The select event type, triggered byselectevent handlers.- See Also:
-
TYPE_AUXCLICK
The auxclick event type, triggered byauxclickevent handlers.- See Also:
-
TYPE_WEBANIMATIONSTART
The webkitanimationstart event type, triggered bywebkitanimationstartevent handlers.- See Also:
-
TYPE_DRAG
The drag event type, triggered bydragevent handlers.- See Also:
-
TYPE_SEEKED
The seeked event type, triggered byseekedevent handlers.- See Also:
-
TYPE_OFFLINE
The offline event type, triggered byofflineevent handlers.- See Also:
-
TYPE_DEVICEORIENTATION
The deviceorientation event type, triggered bydeviceorientationevent handlers.- See Also:
-
TYPE_TOGGLE
The toggle event type, triggered bytoggleevent handlers.- See Also:
-
TYPE_PLAY
The play event type, triggered byplayevent handlers.- See Also:
-
TYPE_LOADEDMETADATA
The loadedmetadata event type, triggered byloadedmetadataevent handlers.- See Also:
-
TYPE_POINTERMOVE
The pointermove event type, triggered bypointermoveevent handlers.- See Also:
-
TYPE_LOSTPOINTERCAPTURE
The lostpointercapture event type, triggered bylostpointercaptureevent handlers.- See Also:
-
TYPE_POINTEROVER
The pointerover event type, triggered bypointeroverevent handlers.- See Also:
-
TYPE_ANIMATIONCANCEL
The animationcancel event type, triggered byanimationcancelevent handlers.- See Also:
-
TYPE_ANIMATIONEND
The animationend event type, triggered byanimationendevent handlers.- See Also:
-
TYPE_DRAGENTER
The dragenter event type, triggered bydragenterevent handlers.- See Also:
-
TYPE_AFTERPRINT
The afterprint event type, triggered byafterprintevent handlers.- See Also:
-
TYPE_MOZFULLSCREENERROR
The mozfullscreenerror event type, triggered bymozfullscreenerrorevent handlers.- See Also:
-
TYPE_MOUSELEAVE
The mouseleave event type, triggered bymouseleaveevent handlers.- See Also:
-
TYPE_MOUSEWHEEL
The mousewheel event type, triggered bymousewheelevent handlers.- See Also:
-
TYPE_SEEKING
The seeking event type, triggered byseekingevent handlers.- See Also:
-
TYPE_CUECHANGE
The cuechange event type, triggered bycuechangeevent handlers.- See Also:
-
TYPE_PAGESHOW
The pageshow event type, triggered bypageshowevent handlers.- See Also:
-
TYPE_MOZFULLSCREENCHANGE
The mozfullscreenchange event type, triggered bymozfullscreenchangeevent handlers.- See Also:
-
TYPE_DURATIONCHANGE
The durationchange event type, triggered bydurationchangeevent handlers.- See Also:
-
TYPE_PLAYING
The playing event type, triggered byplayingevent handlers.- See Also:
-
TYPE_ENDED
The ended event type, triggered byendedevent handlers.- See Also:
-
TYPE_LOADEDDATA
The loadeddata event type, triggered byloadeddataevent handlers.- See Also:
-
TYPE_UNHANDLEDREJECTION
The unhandledrejection event type, triggered byunhandledrejectionevent handlers.- See Also:
-
TYPE_SUSPEND
The suspend event type, triggered bysuspendevent handlers.- See Also:
-
TYPE_WAITING
The waiting event type, triggered bywaitingevent handlers.- See Also:
-
TYPE_CANPLAY
The canplay event type, triggered bycanplayevent handlers.- See Also:
-
TYPE_LANGUAGECHANGE
The languagechange event type, triggered bylanguagechangeevent handlers.- See Also:
-
TYPE_EMPTIED
The emptied event type, triggered byemptiedevent handlers.- See Also:
-
TYPE_REJECTIONHANDLED
The rejectionhandled event type, triggered byrejectionhandledevent handlers.- See Also:
-
TYPE_POINTERCANCEL
The pointercancel event type, triggered bypointercancelevent handlers.- See Also:
-
TYPE_RESIZE
The resize event type, triggered byresizeevent handlers.- See Also:
-
TYPE_PAUSE
The pause event type, triggered bypauseevent handlers.- See Also:
-
TYPE_POINTERUP
The pointerup event type, triggered bypointerupevent handlers.- See Also:
-
TYPE_WHEEL
The wheel event type, triggered bywheelevent handlers.- See Also:
-
TYPE_POINTERLEAVE
The pointerleave event type, triggered bypointerleaveevent handlers.- See Also:
-
TYPE_BEFOREPRINT
The beforeprint event type, triggered bybeforeprintevent handlers.- See Also:
-
TYPE_STORAGE
The storage event type, triggered bystorageevent handlers.- See Also:
-
TYPE_ANIMATIONSTART
The animationstart event type, triggered byanimationstartevent handlers.- See Also:
-
TYPE_TIMEUPDATE
The timeupdate event type, triggered bytimeupdateevent handlers.- See Also:
-
TYPE_PAGEHIDE
The pagehide event type, triggered bypagehideevent handlers.- See Also:
-
TYPE_WEBKITANIMATIONITERATION
The webkitanimationiteration event type, triggered bywebkitanimationiterationevent handlers.- See Also:
-
TYPE_DRAGOVER
The dragover event type, triggered bydragoverevent handlers.- See Also:
-
TYPE_ONLINE
The online event type, triggered byonlineevent handlers.- See Also:
-
TYPE_VOLUMECHANGE
The volumechange event type, triggered byvolumechangeevent handlers.- See Also:
-
TYPE_GOTPOINTERCAPTURE
The gotpointercapture event type, triggered bygotpointercaptureevent handlers.- See Also:
-
TYPE_WEBKITTRANSITIONEND
The webkittransitionend event type, triggered bywebkittransitionendevent handlers.- See Also:
-
TYPE_WEBKITANIMATIONEND
The webkitanimationend event type, triggered bywebkitanimationendevent handlers.- See Also:
-
TYPE_DEVICEMOTION
The devicemotion event type, triggered bydevicemotionevent handlers.- See Also:
-
TYPE_STALLED
The stalled event type, triggered bystalledevent handlers.- See Also:
-
TYPE_MOUDEENTER
The mouseenter event type, triggered bymouseenterevent handlers.- See Also:
-
TYPE_DRAGLEAVE
The dragleave event type, triggered bydragleaveevent handlers.- See Also:
-
TYPE_POINTERDOWN
The pointerdown event type, triggered bypointerdownevent handlers.- See Also:
-
TYPE_DROP
The drop event type, triggered bydropevent handlers.- See Also:
-
TYPE_DRAGSTART
The dragstart event type, triggered bydragstartevent handlers.- See Also:
-
TYPE_TRANSITIONEND
The transitionend event type, triggered bytransitionendevent handlers.- See Also:
-
TYPE_DEVICEORIENTATIONABSOLUTE
The deviceorientationabsolute event type, triggered bydeviceorientationabsoluteevent handlers.- See Also:
-
TYPE_BEFORECOPY
The beforecopy event type, triggered bybeforecopyevent handlers.- See Also:
-
TYPE_BEFORECUT
The beforecut event type, triggered bybeforecutevent handlers.- See Also:
-
TYPE_BEFOREPASTE
The beforepaste event type, triggered bybeforepasteevent handlers.- See Also:
-
TYPE_SELECTSTART
The selectstart event type, triggered byselectstartevent handlers.- See Also:
-
TYPE_WEBKITFULLSCREENCHANGE
The webkitfullscreenchange event type, triggered bywebkitfullscreenchangeevent handlers.- See Also:
-
TYPE_WEBKITFULLSCREENERROR
The webkitfullscreenerror event type, triggered bywebkitfullscreenerrorevent handlers.- See Also:
-
TYPE_COPY
The copy event type, triggered bycopyevent handlers.- See Also:
-
TYPE_CUT
The cut event type, triggered bycutevent handlers.- See Also:
-
TYPE_PASTE
The paste event type, triggered bypasteevent handlers.- See Also:
-
TYPE_ONMESSAGEERROR
The onmessageerror event type, triggered byonmessageerrorevent handlers.- See Also:
-
TYPE_POINTERLOCKCHANGE
The pointerlockchange event type, triggered bypointerlockchangeevent handlers.- See Also:
-
TYPE_POINTERLOCKERROR
The pointerlockerror event type, triggered bypointerlockerrorevent handlers.- See Also:
-
TYPE_SELECTIONCHANGE
The selectionchange event type, triggered byselectionchangeevent handlers.- See Also:
-
TYPE_AFTERSCRIPTEXECUTE
The afterscriptexecute event type, triggered byafterscriptexecuteevent handlers.- See Also:
-
TYPE_BEFORESCRIPTEXECUTE
The beforescriptexecute event type, triggered bybeforescriptexecuteevent handlers.- See Also:
-
TYPE_ONTRANSITIONCANCEL
The ontransitioncancel event type, triggered byontransitioncancelevent handlers.- See Also:
-
TYPE_ONTRANSITIONEND
The ontransitionend event type, triggered byontransitionendevent handlers.- See Also:
-
TYPE_ONTRANSITIONRUN
The ontransitionrun event type, triggered byontransitionrunevent handlers.- See Also:
-
TYPE_ONTRANSITIONSTART
The ontransitionstart event type, triggered byontransitionstartevent handlers.- See Also:
-
TYPE_GAMEPAD_CONNECTED
The ongamepadconnected event type, triggered byongamepadconnectedevent handlers.- See Also:
-
TYPE_GAMEPAD_DISCONNECTED
The ongamepaddisconnected event type, triggered byongamepaddisconnectedevent handlers.- See Also:
-
TYPE_MSSITEMODEJUMPLISTITEMREMOVED
The mssitemodejumplistitemremoved event type, triggered bymssitemodejumplistitemremovedevent handlers.- See Also:
-
NONE
public static final int NONENo event phase.- See Also:
-
CAPTURING_PHASE
public static final int CAPTURING_PHASEThe first event phase: the capturing phase.- See Also:
-
AT_TARGET
public static final int AT_TARGETThe second event phase: at the event target.- See Also:
-
BUBBLING_PHASE
public static final int BUBBLING_PHASEThe third (and final) event phase: the bubbling phase.- See Also:
-
ALT_MASK
public static final int ALT_MASKConstant.- See Also:
-
CONTROL_MASK
public static final int CONTROL_MASKConstant.- See Also:
-
SHIFT_MASK
public static final int SHIFT_MASKConstant.- See Also:
-
META_MASK
public static final int META_MASKConstant.- See Also:
-
srcElement_
-
target_
-
currentTarget_
private org.htmlunit.corejs.javascript.Scriptable currentTarget_ -
type_
-
keyCode_
private int keyCode_ -
shiftKey_
private boolean shiftKey_ -
ctrlKey_
private boolean ctrlKey_ -
altKey_
private boolean altKey_ -
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 Details
-
Event
Creates a new event instance.- Parameters:
domNode- the DOM node that triggered the eventtype- the event type
-
Event
Creates a new event instance.- Parameters:
target- the targettype- the event type
-
Event
public Event()Used to build the prototype.
-
-
Method Details
-
createPropertyChangeEvent
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
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
Returns the object that fired the event.- Returns:
- the object that fired the event
-
setSrcElement
Sets the object that fired the event.- Parameters:
srcElement- the object that fired the event
-
getTarget
Returns the event target to which the event was originally dispatched.- Returns:
- the event target to which the event was originally dispatched
-
setTarget
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
Returns the event type.- Returns:
- the event type
-
setType
Sets the event type.- Parameters:
type- the event type
-
setEventType
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
Handles the return values of property handlers.- Parameters:
returnValue- the return value returned by the property handler
-
getPropertyName
Returns the property name associated with the event.- Returns:
- the property name associated with the event
-
initEvent
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
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
-
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
- Returns:
- the return value property
-
setReturnValue
- Parameters:
newValue- the new return value
-
getComposed
- Returns:
- the return composed property
-
isMissingOrUndefined
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
-