Class BeforeSelectionEvent<T>

Type Parameters:
T - the type about to be selected

public class BeforeSelectionEvent<T> extends GwtEvent<BeforeSelectionHandler<T>>
Represents a before selection event.
  • Constructor Details

    • BeforeSelectionEvent

      protected BeforeSelectionEvent()
      Creates a new before selection event.
  • Method Details

    • fire

      public static <T> BeforeSelectionEvent<T> fire(HasBeforeSelectionHandlers<T> source, T item)
      Fires a before selection event on all registered handlers in the handler manager. If no such handlers exist, this method will do nothing.
      Type Parameters:
      T - the item type
      Parameters:
      source - the source of the handlers
      item - the item
      Returns:
      the event so that the caller can check if it was canceled, or null if no handlers of this event type have been registered
    • getType

      public static GwtEvent.Type<BeforeSelectionHandler<?>> getType()
      Gets the type associated with this event.
      Returns:
      returns the handler type
    • cancel

      public void cancel()
      Cancel the before selection event. Classes overriding this method should still call super.cancel().
    • getAssociatedType

      public final GwtEvent.Type<BeforeSelectionHandler<T>> 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<BeforeSelectionHandler<T>>
      Returns:
      the type
    • getItem

      public T getItem()
      Gets the item.
      Returns:
      the item
    • isCanceled

      public boolean isCanceled()
      Has the selection event already been canceled?
      Returns:
      is canceled
    • dispatch

      protected void dispatch(BeforeSelectionHandler<T> handler)
      Description copied from class: GwtEvent
      Should only be called by HandlerManager. In other words, do not use or call.
      Specified by:
      dispatch in class GwtEvent<BeforeSelectionHandler<T>>
      Parameters:
      handler - handler
      See Also:
    • setItem

      protected final void setItem(T item)
      Sets the item.
      Parameters:
      item - the item