Skip to content

EventListener

interface EventListener<E extends Event>
Package: dev.joid.lib.ui.event · Module: core · Source: EventListener.java

A function that JOID calls with an event, written as a lambda, with a priority that orders it among the other listeners.

Every onX, beforeX and handleX method of JOID takes one. A lambda has the priority EventPriority.NORMAL; wrap it with priority(...) to give it another one.

ReturnsSignatureSummary
EventListener<E>priority(EventPriority priority, EventListener listener) factoryReturns the listener with another priority, for example EventListener.priority(EventPriority.HIGH, event -> ...).

ReturnsSignatureSummary
voidapply(E event) abstractReceives the event; JOID calls it when the event fires.
EventPrioritygetPriority() defaultReturns the priority of the listener, which orders it among the listeners of the same event.

<E extends Event> EventListener<E> priority(EventPriority priority, EventListener<E> listener) factory

Returns the listener with another priority, for example EventListener.priority(EventPriority.HIGH, event -> ...).

void apply(E event) abstract

Receives the event; JOID calls it when the event fires.

EventPriority getPriority() default

Returns the priority of the listener, which orders it among the listeners of the same event.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page