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 IsCastable
Represents 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 NativeBaseEvent
createEvent(String type)
Creates a new event object for a specific event type.static NativeBaseEvent
createEvent(String type, EventInit init)
Creates a new event object for a specific event type with initial configuration.static NativeBaseEvent
createEvent(IsEvent type)
Creates a new event object for a specific event type.static NativeBaseEvent
createEvent(IsEvent type, EventInit init)
Creates a new event object for a specific event type with initial configuration.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.EventPhase
getEventPhase()
Returns which phase of the event flow is currently being evaluated.BaseEventTarget
getTarget()
Returns a reference to the target to which the event was originally dispatched.String
getType()
Returns the type of the event.boolean
isBubbles()
Returnstrue
indicates whether the event bubbles up through the DOM tree or not.boolean
isCancelable()
Returnstrue
indicates 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.boolean
isDefaultPrevented()
Indicates whether or not the call topreventDefault()
canceled the event.void
preventDefault()
Cancels the event (if it is cancelable).void
stopImmediatePropagation()
Prevents all other listeners from being called.void
stopPropagation()
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()
Returnstrue
indicates whether the event bubbles up through the DOM tree or not.- Returns:
true
indicates whether the event bubbles up through the DOM tree or not
-
isCancelable
@JsProperty public final boolean isCancelable()
Returnstrue
indicates 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:
true
indicates 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
-
-