|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eesgmbh.gimv.client.util.EventAccumulator
public class EventAccumulator
A utility class which cumulates GwtEvent instances until for a specified time no
further events were added to the accumulator. If e.g. 100 ms is specified as the accumulation
period, the callback's execute method is invoked 100ms after the last event was added.
A List of GwtEvent instances is passed into the EventAccumulator.Callback
that was specified in the constructor after the accumulation time elapsed.
This helps to reduce server load e.g. if mouse wheel events are 'summed up' during the accumulation period.
| Nested Class Summary | |
|---|---|
static interface |
EventAccumulator.Callback
|
| Constructor Summary | |
|---|---|
EventAccumulator(int callbackExecutionDelay,
EventAccumulator.Callback callback)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addEvent(GwtEvent<? extends EventHandler> gwtEvent)
Adds an event that will be passed into the EventAccumulator.Callback execute-method after the accumulation period elapsed. |
void |
setCallbackExecutionDelay(int callbackExecutionDelay)
How long to wait in milliseconds before invoking the callback's execute method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EventAccumulator(int callbackExecutionDelay,
EventAccumulator.Callback callback)
callbackExecutionDelay - How long to wait in milliseconds before invoking the callback's execute method. If 0, GwtEvents are immediately passed to the Callback,
thus there is no delay (and no internal use of Timer).
callback - A EventAccumulator.Callback implementation whose execute-method will be invoked after the specified delay| Method Detail |
|---|
public void addEvent(GwtEvent<? extends EventHandler> gwtEvent)
EventAccumulator.Callback execute-method after the accumulation period elapsed.
gwtEvent - The GwtEventpublic void setCallbackExecutionDelay(int callbackExecutionDelay)
Timer).
callbackExecutionDelay - Delay in milliseconds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||