com.google.gwt.event.logical.shared

## Class BeforeSelectionEvent<T>

- java.lang.Object
- - com.google.web.bindery.event.shared.Event<H>
  - - com.google.gwt.event.shared.GwtEvent<BeforeSelectionHandler<T>>
    - - com.google.gwt.event.logical.shared.BeforeSelectionEvent<T>

Type Parameters:
  `T` - the type about to be selected

    public class BeforeSelectionEvent<T>
    extends GwtEvent<BeforeSelectionHandler<T>>

Represents a before selection event.

### Nested Class Summary

### Nested classes/interfaces inherited from class com.google.gwt.event.shared.GwtEvent

`GwtEvent.Type<H>`

### Constructor Summary

Constructors
`protected` `BeforeSelectionEvent()` Creates a new before selection event.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `cancel()` Cancel the before selection event.
`protected void` `dispatch(BeforeSelectionHandler<T> handler)` Should only be called by `HandlerManager`.
`static <T> BeforeSelectionEvent<T>` `fire(HasBeforeSelectionHandlers<T> source, T item)` Fires a before selection event on all registered handlers in the handler manager.
`GwtEvent.Type<BeforeSelectionHandler<T>>` `getAssociatedType()` Returns the `Event.Type` used to register this event, allowing an `EventBus` to find handlers of the appropriate class.
`T` `getItem()` Gets the item.
`static GwtEvent.Type<BeforeSelectionHandler<?>>` `getType()` Gets the type associated with this event.
`boolean` `isCanceled()` Has the selection event already been canceled?
`protected void` `setItem(T item)` Sets the item.

### Methods inherited from class com.google.gwt.event.shared.GwtEvent

`assertLive, 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

#### BeforeSelectionEvent

    protected BeforeSelectionEvent()

Creates a new before selection event.

### Method Detail

#### 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:
  `EventBus.dispatchEvent(Event, Object)`

#### setItem

    protected final void setItem(T item)

Sets the item.

Parameters:
  `item` - the item