@StudioFacet(xmlElement="timer", caption="Timer", description="Fires events at fixed intervals", defaultProperty="id", category="Facets", icon="io/jmix/ui/icon/facet/timer.svg") public interface Timer extends Facet
Modifier and Type | Interface and Description |
---|---|
static class |
Timer.TimerActionEvent
Event fired on timer tick.
|
static class |
Timer.TimerStopEvent
Event fired on timer stop after
stop() call. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addTimerActionListener(java.util.function.Consumer<Timer.TimerActionEvent> listener)
Adds
Timer.TimerActionEvent listener. |
io.jmix.core.common.event.Subscription |
addTimerStopListener(java.util.function.Consumer<Timer.TimerStopEvent> listener)
Adds
Timer.TimerStopEvent listener. |
int |
getDelay() |
boolean |
isRepeating() |
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.
|
static final java.lang.String NAME
boolean isRepeating()
@StudioProperty(defaultValue="false") void setRepeating(boolean repeating)
repeating
- repeating flagint getDelay()
@StudioProperty(required=true) @PositiveOrZero void setDelay(int delayMs)
delayMs
- delay in milliseconds.void start()
void stop()
io.jmix.core.common.event.Subscription addTimerActionListener(java.util.function.Consumer<Timer.TimerActionEvent> listener)
Timer.TimerActionEvent
listener.listener
- listenerio.jmix.core.common.event.Subscription addTimerStopListener(java.util.function.Consumer<Timer.TimerStopEvent> listener)
Timer.TimerStopEvent
listener.listener
- listener