|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.Timer
public class Timer
Fires one or more Event after
a specified delay.
Timer is a special component that is invisible.
Notice that the timer won't fire any event until it is attached to a page.
| Nested Class Summary | |
|---|---|
protected class |
Timer.ExtraCtrl
A utility class to implement AbstractComponent.getExtraCtrl(). |
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
AbstractComponent.Children |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
_zclass, RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
_visible |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
Timer()
|
|
Timer(int delay)
|
|
| Method Summary | |
|---|---|
int |
getDelay()
Returns the delay, the number of milliseconds between successive action events. |
java.lang.String |
getOuterAttrs()
Returns the exterior attributes for generating the enclosing HTML tag; never return null. |
boolean |
isChildable()
Not childable. |
boolean |
isRepeats()
Returns whether the timer shall send Event repeatly. |
boolean |
isRunning()
Returns whether this timer is running. |
protected java.lang.Object |
newExtraCtrl()
Used by AbstractComponent.getExtraCtrl() to create a client control. |
void |
setDelay(int delay)
Sets the delay, the number of milliseconds between successive action events. |
void |
setRepeats(boolean repeats)
Sets whether the timer shall send Event repeatly. |
void |
setRunning(boolean running)
Start or stops the timer. |
boolean |
setVisible(boolean visible)
Not allowd. |
void |
start()
Starts the timer. |
void |
stop()
Stops the timer. |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getInnerAttrs, getLeft, getMoldSclass, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, redraw, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent |
|---|
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Constructor Detail |
|---|
public Timer()
public Timer(int delay)
| Method Detail |
|---|
public int getDelay()
Default: 0 (immediately).
getDelay in interface Timer
public void setDelay(int delay)
throws WrongValueException
setDelay in interface TimerWrongValueExceptionpublic boolean isRepeats()
Default: false.
isRepeats in interface Timerpublic void setRepeats(boolean repeats)
setRepeats in interface Timerpublic boolean isRunning()
Default: true.
isRunning in interface Timerstop(),
start()public void setRunning(boolean running)
setRunning in interface Timerpublic void stop()
stop in interface Timerpublic void start()
start in interface Timerpublic java.lang.String getOuterAttrs()
HtmlBasedComponentUsed only by component developers.
Default: Generates the tooltip text, style, sclass, draggable
and droppable attribute if necessary.
In other words, the corresponding attribute is generated if
HtmlBasedComponent.getTooltiptext(), HtmlBasedComponent.getRealStyle(),
HtmlBasedComponent.getSclass(), HtmlBasedComponent.getDraggable(), HtmlBasedComponent.getDroppable()
are defined.
You have to call both HtmlBasedComponent.getOuterAttrs() and
HtmlBasedComponent.getInnerAttrs() to generate complete attributes.
For simple components that all attributes are put on the outest HTML element, all you need is as follows.
<xx id="${self.uuid}"${self.outerAttrs}${self.innerAttrs}>
If you want to put attributes in a nested HTML element, you
shall use the following pattern. Notice: if HtmlBasedComponent.getInnerAttrs()
in a different tag, the tag must be named with "${self.uuid}!real".
<xx id="${self.uuid}"${self.outerAttrs}>
<yy id="${self.uuid}!real"${self.innerAttrs}>...
Note: This class handles non-deferrable event listeners automatically.
However, you have to invoke AbstractComponent.appendAsapAttr(java.lang.StringBuffer, java.lang.String) for each event
the component handles in HtmlBasedComponent.getOuterAttrs() as follows.
appendAsapAttr(sb, Events.ON_OPEN);
appendAsapAttr(sb, Events.ON_CHANGE);
Theorectically, you could put any attributes in either
HtmlBasedComponent.getInnerAttrs() or HtmlBasedComponent.getOuterAttrs().
However, zkau.js assumes all attributes are put at the outer one.
If you want something different, you have to provide your own
setAttr (refer to how checkbox is implemented).
getOuterAttrs in class HtmlBasedComponentpublic boolean setVisible(boolean visible)
setVisible in interface ComponentsetVisible in class AbstractComponentpublic boolean isChildable()
isChildable in interface ComponentisChildable in class AbstractComponentprotected java.lang.Object newExtraCtrl()
HtmlBasedComponentAbstractComponent.getExtraCtrl() to create a client control.
It is used only by component developers.
Defaut: creates an instance of HtmlBasedComponent.ExtraCtrl.
newExtraCtrl in class HtmlBasedComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||