public abstract class SmartGwtTimer
extends java.lang.Object
SmartGwtTimer
is an alternative to GWT's built-in
Timer
class that may allow code to be
executed more efficiently. The SmartClient Framework is aware of threads run using a
SmartGwtTimer
, so extra work (e.g. reflowing
Layout
members, refreshing
DrawItem
s, etc.) queued by a timer's
run()
method gets processed before it returns control to its caller, instead of
being scheduled to run in a future (second) timer call.
Note that if you are replacing or updating components in a
Timer
and notice a visible flash, switching to a
SmartGwtTimer
, which offers identical public APIs to Timer
, may
solve the issue.
Constructor and Description |
---|
SmartGwtTimer() |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels this timer.
|
boolean |
isRunning()
Returns true if the timer is running.
|
abstract void |
run()
This method will be called when a timer fires.
|
void |
schedule(int delayMillis)
Schedules a timer to elapse in the future.
|
void |
scheduleRepeating(int periodMillis)
Schedules a timer that elapses repeatedly.
|
public void cancel()
public boolean isRunning()
public void schedule(int delayMillis)
delayMillis
- delay in milliseconds before timer firespublic void scheduleRepeating(int periodMillis)
periodMillis
- delay in milliseconds between timer firespublic abstract void run()