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 Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DomEvent.Type<H extends EventHandler>` Type class used by dom event subclasses.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DomEvent()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    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.

    - ### 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DomEvent

          public DomEvent()

  - ### Method Detail

    - #### fireNativeEvent

          public static void fireNativeEvent(NativeEvent nativeEvent,
                                             HasHandlers handlerSource)

      Fires the given native event on the specified handlers.
      Parameters:
        `nativeEvent` - the native event
        `handlerSource` - the source of the handlers to fire

    - #### fireNativeEvent

          public static void fireNativeEvent(NativeEvent nativeEvent,
                                             HasHandlers handlerSource,
                                             Element relativeElem)

      Fires the given native event on the specified handlers.
      Parameters:
        `nativeEvent` - the native event
        `handlerSource` - the source of the handlers to fire
        `relativeElem` - the element relative to which event coordinates will be measured

    - #### init

          static void init()

    - #### getAssociatedType

          public abstract DomEvent.Type<H> getAssociatedType()

      Description copied from class: `Event`
      Returns the `Event.Type` used to register this event, allowing an `EventBus` to find handlers of the appropriate class.
      Specified by:
        `getAssociatedType` in class `GwtEvent<H extends EventHandler>`
      Returns:
        the type

    - #### getNativeEvent

          public final NativeEvent getNativeEvent()

      Description copied from interface: `HasNativeEvent`
      Gets the underlying native event.
      Specified by:
        `getNativeEvent` in interface `HasNativeEvent`
      Returns:
        the native event

    - #### getRelativeElement

          public final Element getRelativeElement()

      Gets the element relative to which event coordinates will be measured. If this element is `null`, 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

          public final void setNativeEvent(NativeEvent nativeEvent)

      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

          public void setRelativeElement(Element relativeElem)

      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.