com.sencha.gxt.core.client.util
Class ClickRepeater

java.lang.Object
  extended by com.sencha.gxt.core.client.util.ClickRepeater
All Implemented Interfaces:
ClickRepeaterEvent.HasClickRepeaterHandlers

public class ClickRepeater
extends java.lang.Object
implements ClickRepeaterEvent.HasClickRepeaterHandlers

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


Constructor Summary
ClickRepeater(Widget target, XElement el)
          Creates a new click repeater.
 
Method Summary
 HandlerRegistration addClickHandler(ClickRepeaterEvent.ClickRepeaterHandler handler)
          Adds a ClickRepeaterEvent handler.
 int getDelay()
          Returns the amount before events are fired once the user holds the mouse down.
 XElement getEl()
          Returns the "click" element.
 int getInterval()
          Returns the amount of time between "clicks".
 java.lang.String getPressClass()
          Returns the press CSS style name.
 Widget getTarget()
           
 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 java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClickRepeater

public ClickRepeater(Widget target,
                     XElement el)
Creates a new click repeater.

Parameters:
target - the target widget
el - the element to be clicked
Method Detail

addClickHandler

public HandlerRegistration addClickHandler(ClickRepeaterEvent.ClickRepeaterHandler handler)
Description copied from interface: ClickRepeaterEvent.HasClickRepeaterHandlers
Adds a ClickRepeaterEvent handler.

Specified by:
addClickHandler in interface ClickRepeaterEvent.HasClickRepeaterHandlers
Parameters:
handler - the handler
Returns:
the registration for 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 XElement 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

getTarget

public Widget getTarget()

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


Copyright © 2012. All Rights Reserved.