Package com.google.gwt.event.dom.client
Class DomEvent<H extends EventHandler>
java.lang.Object
com.google.web.bindery.event.shared.Event<H>
com.google.gwt.event.shared.GwtEvent<H>
com.google.gwt.event.dom.client.DomEvent<H>
- Type Parameters:
H
- handler type
- All Implemented Interfaces:
HasNativeEvent
- Direct Known Subclasses:
BlurEvent
,CanPlayThroughEvent
,ChangeEvent
,ContextMenuEvent
,DragDropEventBase
,EndedEvent
,ErrorEvent
,FocusEvent
,GestureChangeEvent
,GestureEndEvent
,GestureStartEvent
,HumanInputEvent
,KeyEvent
,LoadedMetadataEvent
,LoadEvent
,LoseCaptureEvent
,ProgressEvent
,ScrollEvent
public 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().-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
DomEvent.Type<H extends EventHandler>
Type class used by dom event subclasses. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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> Returns theEvent.Type
used to register this event, allowing anEventBus
to find handlers of the appropriate class.final NativeEvent
Gets the underlying native event.final Element
Gets the element relative to which event coordinates will be measured.(package private) static void
init()
void
Prevents the wrapped native event's default action.final 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
Stops the propagation of the underlying native event.Methods inherited from class com.google.gwt.event.shared.GwtEvent
assertLive, dispatch, getSource, isLive, kill, revive
Methods inherited from class com.google.web.bindery.event.shared.Event
setSource, toDebugString, toString
-
Constructor Details
-
DomEvent
public DomEvent()
-
-
Method Details
-
init
static void init() -
getAssociatedType
Description copied from class:Event
Returns theEvent.Type
used to register this event, allowing anEventBus
to find handlers of the appropriate class.- Specified by:
getAssociatedType
in classGwtEvent<H extends EventHandler>
- Returns:
- the type
-
getNativeEvent
Description copied from interface:HasNativeEvent
Gets the underlying native event.- Specified by:
getNativeEvent
in interfaceHasNativeEvent
- Returns:
- the native event
-
getRelativeElement
Gets the element relative to which event coordinates will be measured. If this element isnull
, event coordinates will be measured relative to the window's client area.- Returns:
- the event's relative element
-
preventDefault
public void preventDefault()Prevents the wrapped native event's default action. -
setNativeEvent
Sets the native event associated with this dom event. In general, dom events should be fired using the static firing methods.- Parameters:
nativeEvent
- the native event
-
setRelativeElement
Gets the element relative to which event coordinates will be measured.- Parameters:
relativeElem
- the event's relative element
-
stopPropagation
public void stopPropagation()Stops the propagation of the underlying native event.