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
Nested ClassesModifier and TypeClassDescriptionstatic classDomEvent.Type<H extends EventHandler>Type class used by dom event subclasses. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidfireNativeEvent(NativeEvent nativeEvent, HasHandlers handlerSource) Fires the given native event on the specified handlers.static voidfireNativeEvent(NativeEvent nativeEvent, HasHandlers handlerSource, Element relativeElem) Fires the given native event on the specified handlers.abstract DomEvent.Type<H>Returns theEvent.Typeused to register this event, allowing anEventBusto find handlers of the appropriate class.final NativeEventGets the underlying native event.final ElementGets the element relative to which event coordinates will be measured.(package private) static voidinit()voidPrevents the wrapped native event's default action.final voidsetNativeEvent(NativeEvent nativeEvent) Sets the native event associated with this dom event.voidsetRelativeElement(Element relativeElem) Gets the element relative to which event coordinates will be measured.voidStops the propagation of the underlying native event.Methods inherited from class com.google.gwt.event.shared.GwtEvent
assertLive, dispatch, getSource, isLive, kill, reviveMethods 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:EventReturns theEvent.Typeused to register this event, allowing anEventBusto find handlers of the appropriate class.- Specified by:
getAssociatedTypein classGwtEvent<H extends EventHandler>- Returns:
- the type
-
getNativeEvent
Description copied from interface:HasNativeEventGets the underlying native event.- Specified by:
getNativeEventin 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.