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 interfaceBaseEventTarget.EventListenerCallbackThe 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 voidaddEventListener(String type, CallbackProxy.Proxy listener)Sets up a function that will be called whenever the specified event is delivered to the target.voidaddEventListener(IsEvent type, CallbackProxy.Proxy listener)Sets up a function that will be called whenever the specified event is delivered to the target.booleandispatchEvent(NativeBaseEvent event)Dispatches anNativeBaseEventat the specifiedBaseEventTarget, (synchronously) invoking the affected event listeners in the appropriate order.booleandispatchEvent(HasNativeEvent event)Dispatches anAbstractEventat the specifiedBaseEventTarget, (synchronously) invoking the affected event listeners in the appropriate order.voidremoveEventListener(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.voidremoveEventListener(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 anNativeBaseEventat the specifiedBaseEventTarget, (synchronously) invoking the affected event listeners in the appropriate order.- Parameters:
event- theNativeBaseEventinstance to be dispatched.- Returns:
falseif 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 anAbstractEventat the specifiedBaseEventTarget, (synchronously) invoking the affected event listeners in the appropriate order.- Parameters:
event- theAbstractEventinstance to be dispatched.- Returns:
falseif event is cancelable and at least one of the event handlers which received event calledNativeBaseEvent.preventDefault(), otherwise it returnstrue.
-
-