Interface Event
- All Known Subinterfaces:
AttributeMutateEvent
,CustomEvent
,InputEvent
,MouseEvent
,MutationEvent
,TextChangeEvent
public interface Event
Event interface used to provide contextual information about an event.
-
Method Summary
Modifier and TypeMethodDescriptionGets the event target currently executing this eventGets the document this event was fired in.getPhase()
Gets the current event phase@Nullable Element
Gets the node this event was called on.getType()
Gets the event type.boolean
Tests if this event bubbles.boolean
Tests if this event can be cancelledboolean
Tests if the event has been cancelledboolean
Tests if an internal initialization method has been called, if it has, then this event can be passed toEventTarget.dispatchEvent(Event)
without issue.boolean
Tests if this event should no longer be dispatched to listenersvoid
Stops the 'default' behaviour.void
Stops this event from being propagated to other listeners
-
Method Details
-
getType
-
getTarget
-
getCurrentTarget
EventTarget getCurrentTarget()Gets the event target currently executing this event- Returns:
- Current event target
-
getDocument
-
getPhase
-
isCancelled
boolean isCancelled()Tests if the event has been cancelled- Returns:
true
, ifpreventDefault()
has been called at last once,false
otherwise.
-
isBubbling
boolean isBubbling()Tests if this event bubbles.Bubbling means the event will first be executed at its origin node, and then bubble up through the document tree until it reaches the root element (The body).
- Returns:
true
, if this event is set to bubble.
-
isPropagationStopped
boolean isPropagationStopped()Tests if this event should no longer be dispatched to listeners- Returns:
true
, if this event should no longer be dispatched to listeners,false
otherwise.
-
isCancellable
boolean isCancellable()Tests if this event can be cancelled- Returns:
true
, if the event can be cancelled,false
otherwise.
-
isComposed
boolean isComposed()Tests if an internal initialization method has been called, if it has, then this event can be passed toEventTarget.dispatchEvent(Event)
without issue.- Returns:
true
, if the event has been initialized,false
, otherwise.
-
stopPropagation
void stopPropagation()Stops this event from being propagated to other listeners -
preventDefault
void preventDefault()Stops the 'default' behaviour.If
isCancellable()
returnfalse
, then this function does nothing.
-