public static class

Event.NativePreviewEvent

extends GwtEvent<H extends EventHandler>
implements HasNativeEvent
java.lang.Object
   ↳ com.google.gwt.event.shared.GwtEvent<H extends com.google.gwt.event.shared.EventHandler>
     ↳ com.google.gwt.user.client.Event.NativePreviewEvent

Class Overview

Represents a preview of a native Event.

Summary

Public Constructors
Event.NativePreviewEvent()
Public Methods
void cancel()
Cancel the native event and prevent it from firing.
void consume()
Consume the native event and prevent it from being canceled, even if it has already been canceled by another handler.
final Type<Event.NativePreviewHandler> getAssociatedType()
Returns the type used to register this event.
NativeEvent getNativeEvent()
Gets the underlying native event.
static Type<Event.NativePreviewHandler> getType()
Gets the type associated with this event.
final int getTypeInt()
Gets the type int corresponding to the native event that triggered this preview.
boolean isCanceled()
Has the event already been canceled? Note that isConsumed() will still return true if the native event has also been consumed.
boolean isConsumed()
Has the native event been consumed? Note that isCanceled() will still return true if the native event has also been canceled.
boolean isFirstHandler()
Is the current handler the first to preview this event?
Protected Methods
void dispatch(Event.NativePreviewHandler handler)
Should only be called by HandlerManager.
void revive()
Revives the event.
[Expand]
Inherited Methods
From class com.google.gwt.event.shared.GwtEvent
From class java.lang.Object
From interface com.google.gwt.event.dom.client.HasNativeEvent

Public Constructors

public Event.NativePreviewEvent ()

Public Methods

public void cancel ()

Cancel the native event and prevent it from firing. Note that the event can still fire if another handler calls consume(). Classes overriding this method should still call super.cancel().

public void consume ()

Consume the native event and prevent it from being canceled, even if it has already been canceled by another handler. Event.NativePreviewHandler that fire first have priority over later handlers, so all handlers should check if the event has already been canceled before calling this method.

public final Type<Event.NativePreviewHandler> getAssociatedType ()

Returns the type used to register this event. Used by handler manager to dispatch events to the correct handlers.

Returns
  • the type

public NativeEvent getNativeEvent ()

Gets the underlying native event.

Returns
  • the native event

public static Type<Event.NativePreviewHandler> getType ()

Gets the type associated with this event.

Returns
  • returns the handler type

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

public boolean isCanceled ()

Has the event already been canceled? Note that isConsumed() will still return true if the native event has also been consumed.

Returns
  • true if the event has been canceled
See Also

public boolean isConsumed ()

Has the native event been consumed? Note that isCanceled() will still return true if the native event has also been canceled.

Returns
  • true if the event has been consumed
See Also

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

Protected Methods

protected void dispatch (Event.NativePreviewHandler handler)

Should only be called by HandlerManager. In other words, do not use or call.

Parameters
handler handler

protected void revive ()

Revives the event. Used when recycling event instances.