public interface Event extends Event
Modifier and Type | Method and Description |
---|---|
java.util.Optional<EventTarget> |
currentTarget()
Returns an
Optional that contains the event target that represents the element to
which the event handler has been attached, otherwise an empty Optional . |
boolean |
isBubbles()
Returns
true if the event bubbles up through the DOM, otherwise false. |
boolean |
isCancelable()
Returns
true when the event can be canceled, and therefore prevented as if the event
never happened. |
boolean |
isTrusted()
Returns
true if the event is trusted, and therefore was generated by a user action. |
EventPhase |
phase()
Returns the event phase.
|
void |
preventDefault()
Informs the browser that if the event is not explicitly handled, its default action should
not be performed.
|
void |
stopPropagation()
Informs the browser that the event should not propagate in the capturing and bubbling
phases.
|
java.util.Optional<EventTarget> |
target()
Returns an
Optional that contains the element on which the event occurred if it
exists, otherwise an empty Optional . |
EventType |
type()
Returns the event type.
|
EventType type()
java.util.Optional<EventTarget> target()
Optional
that contains the element on which the event occurred if it
exists, otherwise an empty Optional
.java.util.Optional<EventTarget> currentTarget()
Optional
that contains the event target that represents the element to
which the event handler has been attached, otherwise an empty Optional
.EventPhase phase()
boolean isBubbles()
true
if the event bubbles up through the DOM, otherwise false.boolean isCancelable()
true
when the event can be canceled, and therefore prevented as if the event
never happened. In other case, returns false.boolean isTrusted()
true
if the event is trusted, and therefore was generated by a user action.void preventDefault()
For example, if you invoke this method for the event of the EventType.CLICK
type,
dispatching this event to the checkbox element as the event currentTarget
will not
toggle this checkbox.
java.lang.IllegalStateException
- if the event is closedvoid stopPropagation()
java.lang.IllegalStateException
- if the event is closed