H - handler typepublic abstract class DomEvent<H extends EventHandler> extends GwtEvent<H> implements HasNativeEvent
DomEvent is a subclass of GwtEvent that provides events that
underlying native browser event object as well as a subclass of DomEvent.Type
that understands GWT event bits used by sinkEvents().| Modifier and Type | Class and Description |
|---|---|
static class |
DomEvent.Type<H extends EventHandler>
Type class used by dom event subclasses.
|
| Constructor and Description |
|---|
DomEvent() |
| Modifier and Type | Method and Description |
|---|---|
static void |
fireNativeEvent(NativeEvent nativeEvent,
HasHandlers handlerSource)
Fires the given native event on the specified handlers.
|
static void |
fireNativeEvent(NativeEvent nativeEvent,
HasHandlers handlerSource,
Element relativeElem)
Fires the given native event on the specified handlers.
|
abstract DomEvent.Type<H> |
getAssociatedType()
Returns the
Event.Type used to register this event, allowing an
EventBus to find handlers of the appropriate class. |
NativeEvent |
getNativeEvent()
Gets the underlying native event.
|
Element |
getRelativeElement()
Gets the element relative to which event coordinates will be measured.
|
(package private) static void |
init() |
void |
preventDefault()
Prevents the wrapped native event's default action.
|
void |
setNativeEvent(NativeEvent nativeEvent)
Sets the native event associated with this dom event.
|
void |
setRelativeElement(Element relativeElem)
Gets the element relative to which event coordinates will be measured.
|
void |
stopPropagation()
Stops the propagation of the underlying native event.
|
assertLive, dispatch, getSource, isLive, kill, revivesetSource, toDebugString, toStringpublic static void fireNativeEvent(NativeEvent nativeEvent, HasHandlers handlerSource)
nativeEvent - the native eventhandlerSource - the source of the handlers to firepublic static void fireNativeEvent(NativeEvent nativeEvent, HasHandlers handlerSource, Element relativeElem)
nativeEvent - the native eventhandlerSource - the source of the handlers to firerelativeElem - the element relative to which event coordinates will be
measuredstatic void init()
public abstract DomEvent.Type<H> getAssociatedType()
EventEvent.Type used to register this event, allowing an
EventBus to find handlers of the appropriate class.getAssociatedType in class GwtEvent<H extends EventHandler>public final NativeEvent getNativeEvent()
HasNativeEventgetNativeEvent in interface HasNativeEventpublic final Element getRelativeElement()
null, event coordinates will be measured
relative to the window's client area.public void preventDefault()
public final void setNativeEvent(NativeEvent nativeEvent)
nativeEvent - the native eventpublic void setRelativeElement(Element relativeElem)
relativeElem - the event's relative elementpublic void stopPropagation()