public class ClickRepeater extends Object implements ClickRepeaterEvent.HasClickRepeaterHandlers
Constructor and Description |
---|
ClickRepeater(Widget target,
XElement el)
Creates a new click repeater.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addClickHandler(ClickRepeaterEvent.ClickRepeaterHandler handler)
Adds a
ClickRepeaterEvent handler. |
protected void |
click() |
protected void |
doAttach() |
protected void |
doDetach() |
protected int |
easeOutExpo(long t,
int b,
int c,
int d) |
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".
|
String |
getPressClass()
Returns the press CSS style name.
|
Widget |
getTarget() |
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(String pressClass)
A CSS class name to be applied to the element while pressed.
|
public ClickRepeater(Widget target, XElement el)
target
- the target widgetel
- the element to be clickedpublic HandlerRegistration addClickHandler(ClickRepeaterEvent.ClickRepeaterHandler handler)
ClickRepeaterEvent.HasClickRepeaterHandlers
ClickRepeaterEvent
handler.addClickHandler
in interface ClickRepeaterEvent.HasClickRepeaterHandlers
handler
- the handlerpublic int getDelay()
public XElement getEl()
public int getInterval()
public String getPressClass()
public Widget getTarget()
public boolean isAccelerate()
public void setAccelerate(boolean accelerate)
accelerate
- true to acceleratepublic void setDelay(int delay)
delay
- the delay in millisecondspublic void setInterval(int interval)
interval
- the interval in millisecondspublic void setPressClass(String pressClass)
pressClass
- the style nameprotected void click()
protected void doAttach()
protected void doDetach()
protected int easeOutExpo(long t, int b, int c, int d)
protected void handleMouseDown()
protected void handleMouseOut()
protected void handleMouseReturn()
protected void handleMouseUp()
Copyright © 2018. All rights reserved.