Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.gwt.event.dom.client
Class DomEvent<H extends EventHandler>

    java.lang.Object
      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, ChangeEvent, ClickEvent, ContextMenuEvent, DoubleClickEvent, ErrorEvent, FocusEvent, KeyEvent, LoadEvent, LoseCaptureEvent, MouseEvent, 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
`static class` | `DomEvent.Type<H extends EventHandler>` Type class used by dom event subclasses.

Constructor Summary
`DomEvent()`

Method Summary
`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 type used to register this event.
`NativeEvent` | `getNativeEvent()` Gets the underlying native event.
`Element` | `getRelativeElement()` Gets the element relative to which event coordinates will be measured.
`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, 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

### getAssociatedType

    public abstract DomEvent.Type<H> getAssociatedType()

  Description copied from class: `GwtEvent`
  Returns the type used to register this event. Used by handler manager to dispatch events to the correct handlers.

  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.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD