com.maryanovsky.gwtutils.client.iphone.ui.touch
Class TouchEventsCanceller

java.lang.Object
  extended by com.maryanovsky.gwtutils.client.iphone.ui.touch.HandlesAllTouchEvents
      extended by com.maryanovsky.gwtutils.client.iphone.ui.touch.TouchEventsCanceller
All Implemented Interfaces:
EventHandler, TouchCancelHandler, TouchEndHandler, TouchMoveHandler, TouchStartHandler

public class TouchEventsCanceller
extends HandlesAllTouchEvents

A touch event handler which invokes NativeEvent.stopPropagation() and/or NativeEvent.preventDefault() on all events it receives. To cancel events, register as a handler on the source whose events you wish to cancel.

Author:
Maryanovsky Alexander

Field Summary
static TouchEventsCanceller BOTH
          A TouchEventsCanceller which both stops propagation and prevents the default actions of events.
static TouchEventsCanceller PREVENT_DEFAULT
          A TouchEventsCanceller which only prevents the default actions of events.
static TouchEventsCanceller STOP_PROPAGATION
          A TouchEventsCanceller which only stops propagation of events.
 
Constructor Summary
TouchEventsCanceller(boolean isStopPropagation, boolean isPreventDefault)
          Creates a new TouchEventsCanceller which will optionally stop the propagation and/or prevent the default action of events it receives.
 
Method Summary
 boolean isPreventDefault()
          Returns whether this TouchEventsCanceller is preventing the default action of all events it receives.
 boolean isStopPropagation()
          Returns whether this TouchEventsCanceller is stopping propagation of all events it receives.
 void onTouchCancel(TouchCancelEvent evt)
          Invoked when a touch is canceled.
 void onTouchEnd(TouchEndEvent evt)
          Invoked when a finger is lifted.
 void onTouchMove(TouchMoveEvent evt)
          Invoked when a finger is moved while pressed.
 void onTouchStart(TouchStartEvent evt)
          Invoked when a finger is pressed.
 
Methods inherited from class com.maryanovsky.gwtutils.client.iphone.ui.touch.HandlesAllTouchEvents
handle, handle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STOP_PROPAGATION

public static TouchEventsCanceller STOP_PROPAGATION
A TouchEventsCanceller which only stops propagation of events.


PREVENT_DEFAULT

public static TouchEventsCanceller PREVENT_DEFAULT
A TouchEventsCanceller which only prevents the default actions of events.


BOTH

public static TouchEventsCanceller BOTH
A TouchEventsCanceller which both stops propagation and prevents the default actions of events.

Constructor Detail

TouchEventsCanceller

public TouchEventsCanceller(boolean isStopPropagation,
                            boolean isPreventDefault)
Creates a new TouchEventsCanceller which will optionally stop the propagation and/or prevent the default action of events it receives.

Method Detail

isStopPropagation

public boolean isStopPropagation()
Returns whether this TouchEventsCanceller is stopping propagation of all events it receives.


isPreventDefault

public boolean isPreventDefault()
Returns whether this TouchEventsCanceller is preventing the default action of all events it receives.


onTouchStart

public void onTouchStart(TouchStartEvent evt)
Invoked when a finger is pressed.


onTouchMove

public void onTouchMove(TouchMoveEvent evt)
Invoked when a finger is moved while pressed.


onTouchEnd

public void onTouchEnd(TouchEndEvent evt)
Invoked when a finger is lifted.


onTouchCancel

public void onTouchCancel(TouchCancelEvent evt)
Invoked when a touch is canceled.