Class NativeBaseEvent
- java.lang.Object
-
- org.pepstock.charba.client.dom.events.NativeBaseEvent
-
- All Implemented Interfaces:
IsJSType,IsCastable
- Direct Known Subclasses:
NativeCustomEvent,NativeUIEvent
@JsType(isNative=true, name="Event", namespace="<global>") public abstract class NativeBaseEvent extends Object implements IsCastableRepresents an base event which takes place in the DOM.
There are many types of events, some of which use other interfaces based on the main event interface.
Event itself contains the properties and methods which are common to all events.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NativeBaseEventcreateEvent(String type)Creates a new event object for a specific event type.static NativeBaseEventcreateEvent(String type, EventInit init)Creates a new event object for a specific event type with initial configuration.static NativeBaseEventcreateEvent(IsEvent type)Creates a new event object for a specific event type.static NativeBaseEventcreateEvent(IsEvent type, EventInit init)Creates a new event object for a specific event type with initial configuration.BaseEventTargetgetCurrentTarget()Returns a reference to the currently registered target for the event.
This is the object to which the event is currently slated to be sent.EventPhasegetEventPhase()Returns which phase of the event flow is currently being evaluated.BaseEventTargetgetTarget()Returns a reference to the target to which the event was originally dispatched.StringgetType()Returns the type of the event.booleanisBubbles()Returnstrueindicates whether the event bubbles up through the DOM tree or not.booleanisCancelable()Returnstrueindicates whether the event can be canceled, and therefore prevented as if the event never happened.
If the event is not cancelable, then its cancelable property will be false and the event listener cannot stop the event from occurring.booleanisDefaultPrevented()Indicates whether or not the call topreventDefault()canceled the event.voidpreventDefault()Cancels the event (if it is cancelable).voidstopImmediatePropagation()Prevents all other listeners from being called.voidstopPropagation()Stops the propagation of events further along in the DOM.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.dom.IsCastable
as
-
-
-
-
Method Detail
-
isBubbles
@JsProperty public final boolean isBubbles()
Returnstrueindicates whether the event bubbles up through the DOM tree or not.- Returns:
trueindicates whether the event bubbles up through the DOM tree or not
-
isCancelable
@JsProperty public final boolean isCancelable()
Returnstrueindicates whether the event can be canceled, and therefore prevented as if the event never happened.
If the event is not cancelable, then its cancelable property will be false and the event listener cannot stop the event from occurring.- Returns:
trueindicates whether the event can be canceled, and therefore prevented as if the event never happened
-
getCurrentTarget
@JsProperty public final BaseEventTarget getCurrentTarget()
Returns a reference to the currently registered target for the event.
This is the object to which the event is currently slated to be sent.- Returns:
- a reference to the currently registered target for the event
-
isDefaultPrevented
@JsProperty public final boolean isDefaultPrevented()
Indicates whether or not the call topreventDefault()canceled the event.- Returns:
- Indicates whether or not the call to
preventDefault()canceled the event
-
getTarget
@JsProperty public final BaseEventTarget getTarget()
Returns a reference to the target to which the event was originally dispatched.- Returns:
- a reference to the target to which the event was originally dispatched
-
getType
@JsProperty public final String getType()
Returns the type of the event.- Returns:
- the type of the event
-
preventDefault
@JsMethod public final void preventDefault()
Cancels the event (if it is cancelable).
-
stopImmediatePropagation
@JsMethod public final void stopImmediatePropagation()
Prevents all other listeners from being called.
-
stopPropagation
@JsMethod public final void stopPropagation()
Stops the propagation of events further along in the DOM.
-
createEvent
@JsOverlay public static final NativeBaseEvent createEvent(String type)
Creates a new event object for a specific event type.- Parameters:
type- type of event- Returns:
- a new event object for a specific event type
-
createEvent
@JsOverlay public static final NativeBaseEvent createEvent(IsEvent type)
Creates a new event object for a specific event type.- Parameters:
type- type of event- Returns:
- a new event object for a specific event type
-
createEvent
@JsOverlay public static final NativeBaseEvent createEvent(IsEvent type, EventInit init)
Creates a new event object for a specific event type with initial configuration.- Parameters:
type- type of eventinit- initial configuration of the event- Returns:
- a new event object for a specific event type
-
createEvent
@JsOverlay public static final NativeBaseEvent createEvent(String type, EventInit init)
Creates a new event object for a specific event type with initial configuration.- Parameters:
type- type of eventinit- initial configuration of the event- Returns:
- a new event object for a specific event type
-
getEventPhase
@JsOverlay public final EventPhase getEventPhase()
Returns which phase of the event flow is currently being evaluated.- Returns:
- which phase of the event flow is currently being evaluated
-
-