com.extjs.gxt.ui.client.util
Class ClickRepeater

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.util.ClickRepeater
All Implemented Interfaces:
Observable, ComponentAttachable

public class ClickRepeater
extends BaseObservable
implements ComponentAttachable

A utility class that continues to fire a "click" event when the user holds the mouse key down.

Events:
OnClick : ClickRepeaterEvent(source, el)
Fires when the user holds down the mouse button.


Constructor Summary
ClickRepeater(El el)
          Creates a new click repeater.
 
Method Summary
protected  void click()
           
 void doAttach()
           
 void doDetach()
           
protected  int easeOutExpo(long t, int b, int c, int d)
           
 boolean fireEvent(EventType eventType)
          Fires an event.
 int getDelay()
          Returns the amount before events are fired once the user holds the mouse down.
 El getEl()
          Returns the "click" element.
 int getInterval()
          Returns the amount of time between "clicks".
 java.lang.String getPressClass()
          Returns the press CSS style name.
protected  void handleMouseDown()
           
protected  void handleMouseOut()
           
protected  void handleMouseReturn()
           
protected  void handleMouseUp()
           
 boolean isAccelerate()
          Returns true if acceleration is enabled.
 void setAccelerate(boolean accelerate)
          True if autorepeating should start slowly and accelerate (defaults to false).
 void setDelay(int delay)
          The initial delay before the repeating event begins firing (defaults to 250).
 void setInterval(int interval)
          Sets the interval (defaults to 250).
 void setPressClass(java.lang.String pressClass)
          A CSS class name to be applied to the element while pressed.
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, callListener, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClickRepeater

public ClickRepeater(El el)
Creates a new click repeater.

Parameters:
el - the element to be clicked
Method Detail

doAttach

public void doAttach()
Specified by:
doAttach in interface ComponentAttachable

doDetach

public void doDetach()
Specified by:
doDetach in interface ComponentAttachable

fireEvent

public boolean fireEvent(EventType eventType)
Description copied from class: BaseObservable
Fires an event.

Overrides:
fireEvent in class BaseObservable
Parameters:
eventType - the event type
Returns:
true if any listeners cancel the event.

getDelay

public int getDelay()
Returns the amount before events are fired once the user holds the mouse down.

Returns:
the delay in milliseconds

getEl

public El getEl()
Returns the "click" element.

Returns:
the element

getInterval

public int getInterval()
Returns the amount of time between "clicks".

Returns:
the time in milliseconds

getPressClass

public java.lang.String getPressClass()
Returns the press CSS style name.

Returns:
the press class

isAccelerate

public boolean isAccelerate()
Returns true if acceleration is enabled.

Returns:
true if enabled

setAccelerate

public void setAccelerate(boolean accelerate)
True if autorepeating should start slowly and accelerate (defaults to false). "interval" and "delay" are ignored.

Parameters:
accelerate - true to accelerate

setDelay

public void setDelay(int delay)
The initial delay before the repeating event begins firing (defaults to 250). Similar to an autorepeat key delay.

Parameters:
delay - the delay in milliseconds

setInterval

public void setInterval(int interval)
Sets the interval (defaults to 250).

Parameters:
interval - the interval in milliseconds

setPressClass

public void setPressClass(java.lang.String pressClass)
A CSS class name to be applied to the element while pressed.

Parameters:
pressClass - the style name

click

protected void click()

easeOutExpo

protected int easeOutExpo(long t,
                          int b,
                          int c,
                          int d)

handleMouseDown

protected void handleMouseDown()

handleMouseOut

protected void handleMouseOut()

handleMouseReturn

protected void handleMouseReturn()

handleMouseUp

protected void handleMouseUp()