Package org.pepstock.charba.client.dom
Class BaseEventTarget
- java.lang.Object
-
- org.pepstock.charba.client.dom.BaseEventTarget
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
BaseEventTarget.EventListenerCallback
The object which receives a notification when an event of the specified type occurs.
Represents an object that can handle an event dispatched by a element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEventListener(String type, CallbackProxy.Proxy listener)
Sets up a function that will be called whenever the specified event is delivered to the target.void
addEventListener(IsEvent type, CallbackProxy.Proxy listener)
Sets up a function that will be called whenever the specified event is delivered to the target.boolean
dispatchEvent(NativeBaseEvent event)
Dispatches anNativeBaseEvent
at the specifiedBaseEventTarget
, (synchronously) invoking the affected event listeners in the appropriate order.boolean
dispatchEvent(HasNativeEvent event)
Dispatches anAbstractEvent
at the specifiedBaseEventTarget
, (synchronously) invoking the affected event listeners in the appropriate order.void
removeEventListener(String type, CallbackProxy.Proxy listener)
Removes from the event target an event listener previously registered.
The event listener to be removed is identified using a combination of the event type and the event listener function itself.void
removeEventListener(IsEvent type, CallbackProxy.Proxy listener)
Removes from the event target an event listener previously registered.
The event listener to be removed is identified using a combination of the event type and the event listener function itself.
-
-
-
Method Detail
-
addEventListener
@JsMethod public final void addEventListener(String type, CallbackProxy.Proxy listener)
Sets up a function that will be called whenever the specified event is delivered to the target.- Parameters:
type
- a case-sensitive string representing the event type to listen forlistener
- the object which receives a notification when an event of the specified type occurs
-
removeEventListener
@JsMethod public final void removeEventListener(String type, CallbackProxy.Proxy listener)
Removes from the event target an event listener previously registered.
The event listener to be removed is identified using a combination of the event type and the event listener function itself.- Parameters:
type
- a string which specifies the type of event for which to remove an event listenerlistener
- function instance of the event handler to remove from the event target.
-
dispatchEvent
@JsMethod public final boolean dispatchEvent(NativeBaseEvent event)
Dispatches anNativeBaseEvent
at the specifiedBaseEventTarget
, (synchronously) invoking the affected event listeners in the appropriate order.- Parameters:
event
- theNativeBaseEvent
instance to be dispatched.- Returns:
false
if event is cancelable and at least one of the event handlers which received event calledNativeBaseEvent.preventDefault()
, otherwise it returnstrue
.
-
addEventListener
@JsOverlay public final void addEventListener(IsEvent type, CallbackProxy.Proxy listener)
Sets up a function that will be called whenever the specified event is delivered to the target.- Parameters:
type
- a case-sensitive string representing the event type to listen forlistener
- the object which receives a notification when an event of the specified type occurs
-
removeEventListener
@JsOverlay public final void removeEventListener(IsEvent type, CallbackProxy.Proxy listener)
Removes from the event target an event listener previously registered.
The event listener to be removed is identified using a combination of the event type and the event listener function itself.- Parameters:
type
- a string which specifies the type of event for which to remove an event listenerlistener
- function instance of the event handler to remove from the event target.
-
dispatchEvent
@JsOverlay public final boolean dispatchEvent(HasNativeEvent event)
Dispatches anAbstractEvent
at the specifiedBaseEventTarget
, (synchronously) invoking the affected event listeners in the appropriate order.- Parameters:
event
- theAbstractEvent
instance to be dispatched.- Returns:
false
if event is cancelable and at least one of the event handlers which received event calledNativeBaseEvent.preventDefault()
, otherwise it returnstrue
.
-
-