use of com.haulmont.cuba.gui.events.sys.UiEventsMulticaster in project cuba by cuba-platform.
the class DesktopFrame method enableEventListeners.
protected void enableEventListeners() {
Frame wrapper = getWrapper();
if (wrapper != null) {
List<ApplicationListener> uiEventListeners = ((AbstractFrame) wrapper).getUiEventListeners();
if (uiEventListeners != null) {
for (ApplicationListener listener : uiEventListeners) {
UiEventsMulticaster multicaster = App.getInstance().getUiEventsMulticaster();
multicaster.addApplicationListener(listener);
}
}
}
}
use of com.haulmont.cuba.gui.events.sys.UiEventsMulticaster in project cuba by cuba-platform.
the class DesktopEvents method publish.
@Override
public void publish(ApplicationEvent event) {
if (event instanceof UiEvent) {
if (SwingUtilities.isEventDispatchThread()) {
UiEventsMulticaster multicaster = App.getInstance().getUiEventsMulticaster();
multicaster.multicastEvent(event);
} else {
throw new IllegalStateException("UiEvent cannot be sent from non-EDT thread");
}
} else {
super.publish(event);
}
}
use of com.haulmont.cuba.gui.events.sys.UiEventsMulticaster in project cuba by cuba-platform.
the class WebFrame method enableEventListeners.
protected void enableEventListeners() {
Frame wrapper = getWrapper();
if (wrapper != null) {
List<ApplicationListener> uiEventListeners = ((AbstractFrame) wrapper).getUiEventListeners();
if (uiEventListeners != null) {
for (ApplicationListener listener : uiEventListeners) {
UiEventsMulticaster multicaster = AppUI.getCurrent().getUiEventsMulticaster();
multicaster.addApplicationListener(listener);
}
}
}
}
use of com.haulmont.cuba.gui.events.sys.UiEventsMulticaster in project cuba by cuba-platform.
the class WebFrame method disableEventListeners.
protected void disableEventListeners() {
Frame wrapper = getWrapper();
if (wrapper != null) {
List<ApplicationListener> uiEventListeners = ((AbstractFrame) wrapper).getUiEventListeners();
if (uiEventListeners != null) {
for (ApplicationListener listener : uiEventListeners) {
UiEventsMulticaster multicaster = AppUI.getCurrent().getUiEventsMulticaster();
multicaster.removeApplicationListener(listener);
}
}
}
}
Aggregations