Package io.jmix.ui.component
Interface Timer
- All Superinterfaces:
Facet
- All Known Implementing Classes:
TimerImpl
@StudioFacet(xmlElement="timer",
caption="Timer",
description="Fires events at fixed intervals",
defaultProperty="id",
category="Facets",
icon="io/jmix/ui/icon/facet/timer.svg",
documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/facets/timer.html")
public interface Timer
extends Facet
Client-side timer component that fires events at fixed intervals.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Event fired on timer tick.static class
Event fired on timer stop afterstop()
call. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddTimerActionListener
(Consumer<Timer.TimerActionEvent> listener) AddsTimer.TimerActionEvent
listener.addTimerStopListener
(Consumer<Timer.TimerStopEvent> listener) AddsTimer.TimerStopEvent
listener.int
getDelay()
boolean
void
setDelay
(int delayMs) void
setRepeating
(boolean repeating) Sets repetitive mode for timer action.void
start()
Starts timer.void
stop()
Stops timer if it is running.
-
Field Details
-
NAME
- See Also:
-
-
Method Details
-
isRepeating
boolean isRepeating()- Returns:
- true if timer action is repetitive
-
setRepeating
Sets repetitive mode for timer action.- Parameters:
repeating
- repeating flag
-
getDelay
int getDelay()- Returns:
- delay in milliseconds.
-
setDelay
- Parameters:
delayMs
- delay in milliseconds.
-
start
void start()Starts timer. If timer is already started call will be ignored. -
stop
void stop()Stops timer if it is running. -
addTimerActionListener
AddsTimer.TimerActionEvent
listener.- Parameters:
listener
- listener- Returns:
- subscription
-
addTimerStopListener
AddsTimer.TimerStopEvent
listener.- Parameters:
listener
- listener- Returns:
- subscription
-