|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WTimer
public class WTimer
A utility class which provides timer signals and single-shot timers.
To use a timer, create a WTimer instance, set the timer interval using
setInterval() and connect a slot to the
timeout signal. Then, start the timer using start().
An active timer may be cancelled at any time using stop().
By default, a timer will continue to generate events until you
stop() it. To create a timer that will fire only once,
use setSingleShot().
When connecting stateless slot implementations to the timeout signal, these stateless slot implementations will be used as for any other signal (when Ajax is available).
In clients without (enabled) JavaScript support, the minimum resolution of the timer is one second (1000 milli-seconds), and it is probably wise to use timers sparingly.
A WTimer is only usable inside of a JWt event loop.
If you want to create a timer outside the JWt event loop, take a look at
Timer.
| Constructor Summary | |
|---|---|
WTimer()
Construct a new timer with the given parent. |
|
WTimer(WObject parent)
Construct a new timer with the given parent. |
|
| Method Summary | |
|---|---|
int |
getInterval()
Returns the interval (msec). |
boolean |
isActive()
Returns if the timer is running. |
boolean |
isSingleShot()
Is this timer set to fire only once. |
void |
setInterval(int msec)
Sets the interval (msec). |
void |
setSingleShot(boolean singleShot)
Configures this timer to fire only once. |
void |
start()
Starts the timer. |
void |
stop()
Stops the timer. |
EventSignal1<WMouseEvent> |
timeout()
Signal emitted when the timer timeouts. |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getId, getObjectName, remove, setObjectName, tr |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WTimer(WObject parent)
public WTimer()
Calls this((WObject)null)
| Method Detail |
|---|
public int getInterval()
public void setInterval(int msec)
public boolean isActive()
public boolean isSingleShot()
public void setSingleShot(boolean singleShot)
A Timer is by default not single shot, and will fire continuously, until it is stopped.
public void start()
The timer will be isActive(), until either the
interval has elapsed, after which the timeout signal is activated, or
until stop() is called.
public void stop()
You may stop the timer during its timeout(), or
cancel a running timer at any other time.
start()public EventSignal1<WMouseEvent> timeout()
The WMouseEvent does not provide any meaningful information but is an implementation artefact.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||