Package com.teamdev.jxbrowser.dom.event
Interface Event
- All Superinterfaces:
Event
- All Known Subinterfaces:
CustomEvent,KeyEvent,MouseEvent,TouchEvent,UiEventModifier,WheelEvent
A DOM event, for example, mouse or keyboard event, provides access to the event data and methods
to change the event behavior.
-
Method Summary
Modifier and TypeMethodDescriptionReturns anOptionalthat contains the event target that represents the element to which the event handler has been attached, otherwise an emptyOptional.booleanReturnstrueif the event bubbles up through the DOM, otherwise false.booleanReturnstruewhen the event can be canceled, and therefore prevented as if the event never happened.booleanReturnstrueif the event is trusted, and therefore was generated by a user action.phase()Returns the event phase.voidInforms the browser that if the event is not explicitly handled, its default action should not be performed.voidInforms the browser that the event should not propagate in the capturing and bubbling phases.target()Returns anOptionalthat contains the element on which the event occurred if it exists, otherwise an emptyOptional.type()Returns the event type.
-
Method Details
-
type
EventType type()Returns the event type. -
target
Optional<EventTarget> target()Returns anOptionalthat contains the element on which the event occurred if it exists, otherwise an emptyOptional. -
currentTarget
Optional<EventTarget> currentTarget()Returns anOptionalthat contains the event target that represents the element to which the event handler has been attached, otherwise an emptyOptional. -
phase
EventPhase phase()Returns the event phase. -
isBubbles
boolean isBubbles()Returnstrueif the event bubbles up through the DOM, otherwise false. -
isCancelable
boolean isCancelable()Returnstruewhen the event can be canceled, and therefore prevented as if the event never happened. In other case, returns false. -
isTrusted
boolean isTrusted()Returnstrueif the event is trusted, and therefore was generated by a user action.- Since:
- 7.12
-
preventDefault
void preventDefault()Informs the browser that if the event is not explicitly handled, its default action should not be performed.For example, if you invoke this method for the event of the
EventType.CLICKtype, dispatching this event to the checkbox element as the eventcurrentTargetwill not toggle this checkbox.- Throws:
ObjectClosedException- if the event is closed
-
stopPropagation
void stopPropagation()Informs the browser that the event should not propagate in the capturing and bubbling phases.- Throws:
ObjectClosedException- if the event is closed
-