Search in sources :

Example 1 with UiEventsMulticaster

use of io.jmix.ui.sys.event.UiEventsMulticaster in project jmix by jmix-framework.

the class CompositeComponent method enableEventListeners.

@Internal
protected void enableEventListeners() {
    List<ApplicationListener> listeners = getUiEventListeners();
    if (CollectionUtils.isNotEmpty(listeners)) {
        AppUI ui = AppUI.getCurrent();
        UiEventsMulticaster multicaster = ui.getUiEventsMulticaster();
        for (ApplicationListener listener : uiEventListeners) {
            multicaster.addApplicationListener(listener);
        }
    }
}
Also used : ApplicationListener(org.springframework.context.ApplicationListener) UiEventsMulticaster(io.jmix.ui.sys.event.UiEventsMulticaster) AppUI(io.jmix.ui.AppUI) Internal(io.jmix.core.annotation.Internal)

Example 2 with UiEventsMulticaster

use of io.jmix.ui.sys.event.UiEventsMulticaster in project jmix by jmix-framework.

the class CompositeComponent method disableEventListeners.

@Internal
protected void disableEventListeners() {
    List<ApplicationListener> listeners = getUiEventListeners();
    if (CollectionUtils.isNotEmpty(listeners)) {
        AppUI ui = AppUI.getCurrent();
        UiEventsMulticaster multicaster = ui.getUiEventsMulticaster();
        for (ApplicationListener listener : uiEventListeners) {
            multicaster.removeApplicationListener(listener);
        }
    }
}
Also used : ApplicationListener(org.springframework.context.ApplicationListener) UiEventsMulticaster(io.jmix.ui.sys.event.UiEventsMulticaster) AppUI(io.jmix.ui.AppUI) Internal(io.jmix.core.annotation.Internal)

Example 3 with UiEventsMulticaster

use of io.jmix.ui.sys.event.UiEventsMulticaster in project jmix by jmix-framework.

the class WindowImpl method enableEventListeners.

protected void enableEventListeners() {
    List<ApplicationListener> uiEventListeners = UiControllerUtils.getUiEventListeners(frameOwner);
    if (uiEventListeners != null) {
        AppUI ui = AppUI.getCurrent();
        UiEventsMulticaster multicaster = ui.getUiEventsMulticaster();
        for (ApplicationListener listener : uiEventListeners) {
            multicaster.addApplicationListener(listener);
        }
    }
}
Also used : ApplicationListener(org.springframework.context.ApplicationListener) UiEventsMulticaster(io.jmix.ui.sys.event.UiEventsMulticaster) AppUI(io.jmix.ui.AppUI)

Example 4 with UiEventsMulticaster

use of io.jmix.ui.sys.event.UiEventsMulticaster in project jmix by jmix-framework.

the class WindowImpl method disableEventListeners.

protected void disableEventListeners() {
    List<ApplicationListener> uiEventListeners = UiControllerUtils.getUiEventListeners(frameOwner);
    if (uiEventListeners != null) {
        AppUI ui = AppUI.getCurrent();
        UiEventsMulticaster multicaster = ui.getUiEventsMulticaster();
        for (ApplicationListener listener : uiEventListeners) {
            multicaster.removeApplicationListener(listener);
        }
    }
}
Also used : ApplicationListener(org.springframework.context.ApplicationListener) UiEventsMulticaster(io.jmix.ui.sys.event.UiEventsMulticaster) AppUI(io.jmix.ui.AppUI)

Aggregations

AppUI (io.jmix.ui.AppUI)4 UiEventsMulticaster (io.jmix.ui.sys.event.UiEventsMulticaster)4 ApplicationListener (org.springframework.context.ApplicationListener)4 Internal (io.jmix.core.annotation.Internal)2