use of com.haulmont.cuba.gui.events.sys.UiEventListenerMethodAdapter in project cuba by cuba-platform.
the class ControllerDependencyInjector method injectEventListeners.
protected void injectEventListeners(Frame frame) {
Class<? extends Frame> clazz = frame.getClass();
List<Method> eventListenerMethods = getAnnotatedListenerMethods(clazz);
if (!eventListenerMethods.isEmpty()) {
Events events = (Events) applicationContext.getBean(Events.NAME);
List<ApplicationListener> listeners = eventListenerMethods.stream().map(m -> new UiEventListenerMethodAdapter(frame, clazz, m, events)).collect(Collectors.toList());
((AbstractFrame) frame).setUiEventListeners(listeners);
}
}
Aggregations