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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
EventListener<E> | priority(EventPriority priority, EventListener | Returns the listener with another priority, for example EventListener.priority(EventPriority.HIGH, event -> ...). |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
Creation details
Section titled “Creation details”priority
Section titled “priority”<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 -> ...).
Method details
Section titled “Method details”void apply(E event) abstract
Receives the event; JOID calls it when the event fires.
getPriority
Section titled “getPriority”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
