Package com.vaadin.swingkit.client
Interface VaadinEventNotifier
- All Known Implementing Classes:
JCefJVaadinPanel,JVaadinPanel
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A
VaadinEventNotifier is responsible to handle and update listeners
of Vaadin actions. It should be notified when a Vaadin action occurs and then
forwards it to any registered listener.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddEventListener(String eventType, VaadinEventListener eventListener) Adds a listener to be notified when an action occurs.default voidUnregister all listeners.default voidclearListeners(String eventType) Unregister all listeners of a certain event type.default voidfireEvent(VaadinSwingEvent event) Emits an event to all registered listeners of the same type as the event's.Get a map with one list for each type of all listeners registered in this notifier.default voidremoveEventListener(String eventType, VaadinEventListener eventListener) Removes a listener, so it is no longer notified when an action occurs.
-
Method Details
-
addEventListener
Adds a listener to be notified when an action occurs.- Parameters:
eventType- the type of events the listener should listen to.eventListener- the listener to add.
-
removeEventListener
Removes a listener, so it is no longer notified when an action occurs.- Parameters:
eventType- the type of the event the listener is registered to listen.eventListener- the listener to remove.
-
fireEvent
Emits an event to all registered listeners of the same type as the event's.- Parameters:
event- the event to emit.
-
clearListeners
Unregister all listeners of a certain event type.- Parameters:
eventType- the type of event to clear of listeners.
-
clearListeners
default void clearListeners()Unregister all listeners. -
getListeners
Map<String,List<VaadinEventListener>> getListeners()Get a map with one list for each type of all listeners registered in this notifier.- Returns:
- a map with one list of all registered listeners for each event type.
-