Package io.jmix.flowui.sys.event
Class UiEventsManager
java.lang.Object
io.jmix.flowui.sys.event.UiEventsManager
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addApplicationListener
(com.vaadin.flow.component.Component component, org.springframework.context.ApplicationListener<?> listener) Adds application listener that should be invoked when corresponding application event is fired.protected Collection<org.springframework.context.ApplicationListener<?>>
filterComponentListeners
(UiEventsManager.ComponentListeners componentListeners, org.springframework.core.ResolvableType eventType, Class<?> sourceType) protected void
invokeListener
(org.springframework.context.ApplicationListener listener, org.springframework.context.ApplicationEvent event) void
publish
(Collection<com.vaadin.flow.component.UI> uis, org.springframework.context.ApplicationEvent event) Publishes application event for provided UIs.void
Removes all application listeners for all components.void
removeApplicationListener
(org.springframework.context.ApplicationListener<?> listener) Removes application listener.void
removeApplicationListeners
(com.vaadin.flow.component.Component component) Removes all application listeners that have definition in the given component.protected org.springframework.core.ResolvableType
resolveDefaultEventType
(org.springframework.context.ApplicationEvent event) protected Collection<org.springframework.context.ApplicationListener<?>>
retrieveApplicationListeners
(Collection<com.vaadin.flow.component.UI> uis, org.springframework.core.ResolvableType eventType, Class<?> sourceType) Retrieves application listeners from UIs that support provided event type.protected boolean
supportsEvent
(org.springframework.context.ApplicationListener<?> listener, org.springframework.core.ResolvableType eventType, Class<?> sourceType)
-
Field Details
-
listeners
-
-
Constructor Details
-
UiEventsManager
public UiEventsManager()
-
-
Method Details
-
addApplicationListener
public void addApplicationListener(com.vaadin.flow.component.Component component, org.springframework.context.ApplicationListener<?> listener) Adds application listener that should be invoked when corresponding application event is fired.- Parameters:
component
- the component that contains listener definition.listener
- application listener
-
removeApplicationListener
public void removeApplicationListener(org.springframework.context.ApplicationListener<?> listener) Removes application listener.- Parameters:
listener
- listener to remove
-
removeApplicationListeners
public void removeApplicationListeners(com.vaadin.flow.component.Component component) Removes all application listeners that have definition in the given component.- Parameters:
component
- component
-
removeAllApplicationListeners
public void removeAllApplicationListeners()Removes all application listeners for all components. -
publish
public void publish(Collection<com.vaadin.flow.component.UI> uis, org.springframework.context.ApplicationEvent event) Publishes application event for provided UIs. Empty collection of UIs means iterating all existing UIs in the current session.- Parameters:
uis
- collection of UIsevent
- event to publish
-
invokeListener
protected void invokeListener(org.springframework.context.ApplicationListener listener, org.springframework.context.ApplicationEvent event) -
resolveDefaultEventType
protected org.springframework.core.ResolvableType resolveDefaultEventType(org.springframework.context.ApplicationEvent event) -
retrieveApplicationListeners
protected Collection<org.springframework.context.ApplicationListener<?>> retrieveApplicationListeners(Collection<com.vaadin.flow.component.UI> uis, org.springframework.core.ResolvableType eventType, @Nullable Class<?> sourceType) Retrieves application listeners from UIs that support provided event type. Empty collection of UIs means iterating all existing UIs in the current session.- Parameters:
uis
- collection of UIseventType
- type of eventsourceType
- type of source- Returns:
- collection of application listeners that supports provided event type
-
filterComponentListeners
protected Collection<org.springframework.context.ApplicationListener<?>> filterComponentListeners(UiEventsManager.ComponentListeners componentListeners, org.springframework.core.ResolvableType eventType, @Nullable Class<?> sourceType) -
supportsEvent
protected boolean supportsEvent(org.springframework.context.ApplicationListener<?> listener, org.springframework.core.ResolvableType eventType, @Nullable Class<?> sourceType)
-