Package org.zkoss.zul

Class Timer

All Implemented Interfaces:
Serializable, 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:
  • Constructor Details

    • Timer

      public Timer()
    • Timer

      public Timer(int delay)
  • Method Details

    • 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:
    • 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.
    • isChildable

      protected boolean isChildable()
      Not childable.
      Overrides:
      isChildable in class AbstractComponent
    • service

      public void service(AuRequest request, boolean everError)
      Processes an AU request.

      Default: in addition to what are handled by HtmlBasedComponent.service(org.zkoss.zk.au.AuRequest, boolean), it also handles onOpen.

      Specified by:
      service in interface ComponentCtrl
      Overrides:
      service in class HtmlBasedComponent
      everError - whether any error ever occurred before processing this request.
      Since:
      5.0.0
      See Also:
    • renderProperties

      protected void renderProperties(ContentRenderer renderer) throws IOException
      Description copied from class: HtmlBasedComponent
      Renders the content of this component, excluding the enclosing tags and children.

      See also ZK Client-side Reference: Property Rendering

      Overrides:
      renderProperties in class HtmlBasedComponent
      Throws:
      IOException