Package org.opencms.gwt.client.util
Class CmsBurstEventManager
java.lang.Object
org.opencms.gwt.client.util.CmsBurstEventManager
Takes care of the burst of the same event, by skipping the first ones and executing only the last one.
Usage example:
Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { CmsBurstEventManager.get().schedule("resize-window", new Command() { public void execute() { // resize } }, 200); } });
- Since:
- 8.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Removes the event from the manager.protected static CmsBurstEventManager
get()
Returns the singleton instance.void
Adds an 'burst' event to the manager.
-
Method Details
-
get
Returns the singleton instance.- Returns:
- the singleton instance
-
schedule
Adds an 'burst' event to the manager.- Parameters:
name
- the unique name, which identifies the eventcommand
- command to execute when the timer expiresdelayMsec
- the timer delay (it's reseted if multiple events are added)
-
cancel
Removes the event from the manager.- Parameters:
eventName
- the name of the event that we need to remove
-