L - the listener type of this routerE - the reactive event type of this routerpublic abstract class ReactiveEventRouter<L,E extends ReactiveValueChangeEvent> extends Object
Reactive
and Computation. Listeners can be added both for a specific event
type and for the generic value change. All events are fired to both types of
listeners, as well as to event collectors registered using
Reactive.addEventCollector(ReactiveValueChangeListener).| Constructor and Description |
|---|
ReactiveEventRouter(ReactiveValue reactiveValue)
Creates a new event router for a reactive value.
|
| Modifier and Type | Method and Description |
|---|---|
elemental.events.EventRemover |
addListener(L listener)
Adds a listener to this event router.
|
elemental.events.EventRemover |
addReactiveListener(ReactiveValueChangeListener reactiveValueChangeListener)
Adds a generic reactive change listener to this router.
|
protected abstract void |
dispatchEvent(L listener,
E event)
Callback for dispatching an event to a listener.
|
void |
fireEvent(E event)
Fires an event to all listeners added to this router using
addListener(Object) or
addReactiveListener(ReactiveValueChangeListener) as well as all
global event collectors added using
Reactive.addEventCollector(ReactiveValueChangeListener). |
ReactiveValue |
getReactiveValue()
Gets the reactive value for which this router fires event.
|
void |
registerRead()
Registers access to the data for which this event router fires event.
|
protected abstract L |
wrap(ReactiveValueChangeListener reactiveValueChangeListener)
Callback for wrapping a generic reactive change listener to an instance
of the listener type natively supported by this event router.
|
public ReactiveEventRouter(ReactiveValue reactiveValue)
reactiveValue - the reactive value, not nullpublic elemental.events.EventRemover addListener(L listener)
listener - the listener to add, not nullpublic elemental.events.EventRemover addReactiveListener(ReactiveValueChangeListener reactiveValueChangeListener)
reactiveValueChangeListener - the change listener to add, not nullpublic void fireEvent(E event)
addListener(Object) or
addReactiveListener(ReactiveValueChangeListener) as well as all
global event collectors added using
Reactive.addEventCollector(ReactiveValueChangeListener).event - the event to firepublic void registerRead()
public ReactiveValue getReactiveValue()
protected abstract L wrap(ReactiveValueChangeListener reactiveValueChangeListener)
reactiveValueChangeListener - the reactive change listenerCopyright © 2000–2025 Vaadin Ltd. All rights reserved.