Package org.zkoss.zul

Class Timer

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Component, Scope, ComponentCtrl

    public class Timer
    extends HtmlBasedComponent
    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.

    Author:
    tomyeh
    See Also:
    Serialized Form
    • Constructor Detail

      • Timer

        public Timer()
      • Timer

        public Timer​(int delay)
    • Method Detail

      • getDelay

        public int getDelay()
        Returns the delay, the number of milliseconds between successive action events.

        Default: 0 (immediately).

      • setDelay

        public void setDelay​(int delay)
        Sets the delay, the number of milliseconds between successive action events.
        Parameters:
        delay - If negative, 0 is assumed.
      • isRepeats

        public boolean isRepeats()
        Returns whether the timer shall send Event repeatedly.

        Default: false.

      • setRepeats

        public void setRepeats​(boolean repeats)
        Sets whether the timer shall send Event repeatedly.
      • isRunning

        public boolean isRunning()
        Returns whether this timer is running.

        Default: true.

        See Also:
        stop(), start()
      • setRunning

        public void setRunning​(boolean running)
        Start or stops the timer.
      • stop

        public void stop()
        Stops the timer.
      • start

        public void start()
        Starts the timer.