Class DomEvent<H extends EventHandler>

    • 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()
      • 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.