01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08: package com.gwtext.client.util;
09:
10: import com.google.gwt.user.client.Element;
11: import com.gwtext.client.core.BaseConfig;
12:
13: /**
14: * ClickRepeater configuration class.
15: */
16: public class ClickRepeaterConfig extends BaseConfig {
17:
18: /**
19: * True if autorepeating should start slowly and accelerate.
20: * "interval" and "delay" are ignored. "immediate" is honored.
21: *
22: * @param accelerate true to start slowly and accelerate
23: */
24: public void setAccelerate(boolean accelerate) {
25: JavaScriptObjectHelper.setAttribute(jsObj, "accelerate",
26: accelerate);
27: }
28:
29: /**
30: * The initial delay before the repeating event begins firing. Similar to an autorepeat key delay.
31: *
32: * @param delay delay in milliseconds. Default is 250
33: */
34: public void setDelay(int delay) {
35: JavaScriptObjectHelper.setAttribute(jsObj, "delay", delay);
36: }
37:
38: /**
39: * The element to act as a button.
40: *
41: * @param element the element
42: */
43: public void setElement(Element element) {
44: JavaScriptObjectHelper.setAttribute(jsObj, "el", element);
45: }
46:
47: /**
48: * The element to act as a button.
49: *
50: * @param elementID the element ID
51: */
52: public void setElement(String elementID) {
53: JavaScriptObjectHelper.setAttribute(jsObj, "el", elementID);
54: }
55:
56: /**
57: * The interval between firings of the "click" event. Default is 10 milliseconds.
58: *
59: * @param interval the firing interval
60: */
61: public void setInterval(int interval) {
62: JavaScriptObjectHelper
63: .setAttribute(jsObj, "interval", interval);
64: }
65:
66: /**
67: * A CSS class name to be applied to the element while pressed.
68: *
69: * @param pressClass the press CSS class
70: */
71: public void setPressClass(String pressClass) {
72: JavaScriptObjectHelper.setAttribute(jsObj, "pressClass",
73: pressClass);
74: }
75:
76: /**
77: * True to prevent the default click event. Default is true.
78: *
79: * @param preventDefault true to prevent default click
80: */
81: public void setPreventDefault(boolean preventDefault) {
82: JavaScriptObjectHelper.setAttribute(jsObj, "preventDefault",
83: preventDefault);
84: }
85:
86: /**
87: * True to stop the default click event. Default is false.
88: *
89: * @param stopDefault true to stop default click event
90: */
91: public void setStopDefault(boolean stopDefault) {
92: JavaScriptObjectHelper.setAttribute(jsObj, "stopDefault",
93: stopDefault);
94: }
95: }
|