Class KeyDownEventDispatchingUtil

java.lang.Object
com.jadice.web.util.gwt.client.KeyDownEventDispatchingUtil

public class KeyDownEventDispatchingUtil extends Object
Delivers key down events from a single source widget to an arbitrary number of target widgets. Especially used to support keyboard shortcuts.

The event target of a key event is the currently focused element which is processing the keyboard activity. If no suitable element is in focus, the event target will be the HTML body element if available, otherwise the root element. To guarantee that events are properly delivered the RootPanel should be supplied as source widget.

For further details see:
http://www.w3.org/TR/DOM-Level-3-Events/#events-keyboard-event-order
*

  • Constructor Details

    • KeyDownEventDispatchingUtil

      public KeyDownEventDispatchingUtil()
  • Method Details

    • dispatch

      public static void dispatch(com.google.gwt.user.client.ui.IsWidget source, com.google.gwt.user.client.ui.IsWidget... children)
      Dispatch the events received on the given IsWidget source to the specified widgets.
      Parameters:
      source - the source of the Event
      children - the widgets that shall receive the events.
    • dispatchPanel

      public static <T extends com.google.gwt.user.client.ui.IsWidget & com.google.gwt.user.client.ui.IndexedPanel> void dispatchPanel(T source)
      Dispatch the events received on the given IsWidget source to all child widgets of the source.
      Type Parameters:
      T - the receiving widget.
      Parameters:
      source - the source of the Event
    • dispatchTo

      public static <T> void dispatchTo(com.google.gwt.user.client.ui.IsWidget source, KeyDownEventDispatchingUtil.HasChildren<T> children)
      Dispatch the events received on the given IsWidget source to an implementation of KeyDownEventDispatchingUtil.HasChildren.
      Type Parameters:
      T - the children type
      Parameters:
      source - the source of the Event
      children - a KeyDownEventDispatchingUtil.HasChildren implementation