Class ThrottlingSettings
- java.lang.Object
-
- org.apache.wicket.ajax.attributes.ThrottlingSettings
-
- All Implemented Interfaces:
Serializable
,IClusterable
public class ThrottlingSettings extends Object implements IClusterable
Class to keep track of throttling settings.- Author:
- ivaynberg
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ThrottlingSettings(String id, Duration delay)
Construct.ThrottlingSettings(String id, Duration delay, boolean postponeTimerOnUpdate)
Construct.ThrottlingSettings(Duration delay)
Construct without id (will default to the component's markup ID) and postponeTimerOnUpdate set to false.ThrottlingSettings(Duration delay, boolean postponeTimerOnUpdate)
Construct without id (will default to the component's markup ID).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Duration
getDelay()
String
getId()
This id is used by the client-side throttling code to keep track of the various event throttles.boolean
getPostponeTimerOnUpdate()
If it is set to true, then the timer is reset each time the throttle function gets called.void
setDelay(Duration delay)
void
setPostponeTimerOnUpdate(boolean postponeTimerOnUpdate)
-
-
-
Constructor Detail
-
ThrottlingSettings
public ThrottlingSettings(Duration delay)
Construct without id (will default to the component's markup ID) and postponeTimerOnUpdate set to false.- Parameters:
delay
- throttle delay
-
ThrottlingSettings
public ThrottlingSettings(Duration delay, boolean postponeTimerOnUpdate)
Construct without id (will default to the component's markup ID).- Parameters:
delay
- throttle delaypostponeTimerOnUpdate
- postpone timer
-
ThrottlingSettings
public ThrottlingSettings(String id, Duration delay)
Construct.- Parameters:
id
- throttle iddelay
- throttle delay
-
ThrottlingSettings
public ThrottlingSettings(String id, Duration delay, boolean postponeTimerOnUpdate)
Construct.- Parameters:
id
- throttle iddelay
- the amount of time the action should be postponed
-
-
Method Detail
-
getId
public String getId()
This id is used by the client-side throttling code to keep track of the various event throttles. Normally you can just use any unique ID here, such as the component's markupId (Component.getMarkupId()
). To unite several different events with one throttle, give them the same ID. If this is null, it will (on the client only) default to the component's markupId.- Returns:
- throttle id
-
getPostponeTimerOnUpdate
public boolean getPostponeTimerOnUpdate()
If it is set to true, then the timer is reset each time the throttle function gets called. Use this behaviour if you want something to happen at X milliseconds after the last call to throttle. If the parameter is not set, or set to false, then the timer is not reset.
-
setPostponeTimerOnUpdate
public void setPostponeTimerOnUpdate(boolean postponeTimerOnUpdate)
-
-