Package com.google.gwt.user.client
Class Event.NativePreviewEvent
java.lang.Object
com.google.web.bindery.event.shared.Event<H>
com.google.gwt.event.shared.GwtEvent<Event.NativePreviewHandler>
com.google.gwt.user.client.Event.NativePreviewEvent
- All Implemented Interfaces:
HasNativeEvent
- Enclosing class:
- Event
public static class Event.NativePreviewEvent
extends GwtEvent<Event.NativePreviewHandler>
implements HasNativeEvent
Represents a preview of a native
Event.-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gwt.event.shared.GwtEvent
GwtEvent.Type<H> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancel the native event and prevent it from firing.voidconsume()Consume the native event and prevent it from being canceled, even if it has already been canceled by another handler.protected voiddispatch(Event.NativePreviewHandler handler) Should only be called byHandlerManager.Returns theEvent.Typeused to register this event, allowing anEventBusto find handlers of the appropriate class.Gets the underlying native event.getType()Gets the type associated with this event.final intGets the type int corresponding to the native event that triggered this preview.booleanHas the event already been canceled? Note thatisConsumed()will still return true if the native event has also been consumed.booleanHas the native event been consumed? Note thatisCanceled()will still return true if the native event has also been canceled.booleanIs the current handler the first to preview this event?protected voidrevive()Revives the event.Methods inherited from class com.google.gwt.event.shared.GwtEvent
assertLive, getSource, isLive, killMethods inherited from class com.google.web.bindery.event.shared.Event
setSource, toDebugString, toString
-
Constructor Details
-
NativePreviewEvent
public NativePreviewEvent()
-
-
Method Details
-
getType
Gets the type associated with this event.- Returns:
- returns the handler type
-
cancel
public void cancel()Cancel the native event and prevent it from firing. Note that the event can still fire if another handler callsconsume(). Classes overriding this method should still call super.cancel(). -
consume
public void consume()Consume the native event and prevent it from being canceled, even if it has already been canceled by another handler.Event.NativePreviewHandlerthat fire first have priority over later handlers, so all handlers should check if the event has already been canceled before calling this method. -
getAssociatedType
Description copied from class:EventReturns theEvent.Typeused to register this event, allowing anEventBusto find handlers of the appropriate class.- Specified by:
getAssociatedTypein classGwtEvent<Event.NativePreviewHandler>- Returns:
- the type
-
getNativeEvent
Description copied from interface:HasNativeEventGets the underlying native event.- Specified by:
getNativeEventin interfaceHasNativeEvent- Returns:
- the native event
-
getTypeInt
public final int getTypeInt()Gets the type int corresponding to the native event that triggered this preview.- Returns:
- the type int associated with this native event
-
isCanceled
public boolean isCanceled()Has the event already been canceled? Note thatisConsumed()will still return true if the native event has also been consumed.- Returns:
- true if the event has been canceled
- See Also:
-
isConsumed
public boolean isConsumed()Has the native event been consumed? Note thatisCanceled()will still return true if the native event has also been canceled.- Returns:
- true if the event has been consumed
- See Also:
-
isFirstHandler
public boolean isFirstHandler()Is the current handler the first to preview this event?- Returns:
- true if the current handler is the first to preview the event
-
dispatch
Description copied from class:GwtEventShould only be called byHandlerManager. In other words, do not use or call.- Specified by:
dispatchin classGwtEvent<Event.NativePreviewHandler>- Parameters:
handler- handler- See Also:
-
revive
protected void revive()Description copied from class:GwtEventRevives the event. Used when recycling event instances.- Overrides:
revivein classGwtEvent<Event.NativePreviewHandler>
-