Search in sources :

Example 1 with UiEvent

use of com.haulmont.cuba.gui.events.UiEvent 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);
    }
}
Also used : UiEvent(com.haulmont.cuba.gui.events.UiEvent) UiEventsMulticaster(com.haulmont.cuba.gui.events.sys.UiEventsMulticaster)

Aggregations

UiEvent (com.haulmont.cuba.gui.events.UiEvent)1 UiEventsMulticaster (com.haulmont.cuba.gui.events.sys.UiEventsMulticaster)1