Interface Timer

All Superinterfaces:
Facet
All Known Implementing Classes:
TimerImpl

public interface Timer extends Facet
Client-side timer component that fires events at fixed intervals.
  • Field Details

  • Method Details

    • isRepeating

      boolean isRepeating()
      Returns:
      true if timer action is repetitive
    • setRepeating

      void setRepeating(boolean repeating)
      Sets repetitive mode for timer action.
      Parameters:
      repeating - repeating flag
    • getDelay

      int getDelay()
      Returns:
      delay in milliseconds.
    • setDelay

      void setDelay(int delayMs)
      Parameters:
      delayMs - delay in milliseconds.
    • isAutostart

      boolean isAutostart()
      Returns:
      true if timer starts automatically when added to a view.
    • setAutostart

      void setAutostart(boolean autostart)
      Sets whether timer should start automatically when added to a view
      Parameters:
      autostart - autostart flag
    • start

      void start()
      Starts the timer. If the timer is already started call will be ignored.
    • stop

      void stop()
      Stops the timer if it is running.
    • addTimerActionListener

      com.vaadin.flow.shared.Registration addTimerActionListener(Consumer<Timer.TimerActionEvent> listener)
      Adds Timer.TimerActionEvent listener.
      Parameters:
      listener - Timer.TimerActionEvent listener
      Returns:
      listener registration
    • addTimerStopListener

      com.vaadin.flow.shared.Registration addTimerStopListener(Consumer<Timer.TimerStopEvent> listener)
      Adds Timer.TimerStopEvent listener.
      Parameters:
      listener - Timer.TimerStopEvent listener
      Returns:
      listener registration