T - Type of the source of this event.L - Type of the listener which can handle this event.public class SequentialEvent<T,L extends Listener> extends Event<T,L>
SynchronousEventProviders. It supports prevention of nested Events when
being dispatched.| Constructor and Description |
|---|
SequentialEvent(T source,
Class<L> listenerClass)
Creates a new event with a given source.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSuppressedEvent(SuppressedEvent e)
Adds a SuppressedEvent to the set of suppressed events of
this Event.
|
Optional<Event<?,?>> |
getCause()
Gets the cause of this event.
|
Optional<EventStack> |
getEventStack()
Gets the current event stack.
|
Set<Class<?>> |
getPrevented()
Gets the listener classes to which dispatching should be prevented while
this event is being dispatched.
|
Set<SuppressedEvent> |
getSuppressedEvents()
Gets a read-only set of the suppressed events that have been registered
at this event using
addSuppressedEvent(SuppressedEvent). |
void |
preventCascade()
Prevents to dispatch events with the same listener class as this one as
long as this event is being dispatched.
|
<E extends Listener> |
preventCascade(Class<E> listenerClass)
Prevents to dispatch events to the given listener class while this event
is being dispatched.
|
void |
setEventStack(EventStack eventStack)
Sets the EventStack which is used while this event is dispatched.
|
getListenerClass, getListenerStore, getProperties, getSource, getValue, getValueAs, isHandled, isPrevented, setHandled, setListenerStore, setPrevented, setValue, stopNotifyingpublic void setEventStack(EventStack eventStack)
SequentialEventProvider right
before dispatching this event. The stack is only set once, subsequent
calls will have no effect.eventStack - The current event stack.public Optional<Event<?,?>> getCause()
public Optional<EventStack> getEventStack()
setEventStack(EventStack) before dispatching (like
SequentialEventProvider).public void addSuppressedEvent(SuppressedEvent e)
preventCascade(Class), then the prevented event is
registered here using this method.e - The event to add.IllegalArgumentException - If the event is null.public Set<SuppressedEvent> getSuppressedEvents()
addSuppressedEvent(SuppressedEvent).public <E extends Listener> void preventCascade(Class<E> listenerClass)
EventStack.
Note: this method has to be called before this event is being dispatched. If called during dispatch, it will have no effect.
E - Type of the listener class.listenerClass - The listener class to prevent being notified.preventCascade()public void preventCascade()
EventStack.preventCascade(Class)public Set<Class<?>> getPrevented()
preventCascade(Class)Copyright © 2014–2015. All rights reserved.