List of usage examples for com.vaadin.event MethodEventSource addListener
public Registration addListener(Class<?> eventType, Object object, String methodName);
From source file:org.lunifera.runtime.web.vaadin.databinding.component.internal.ComponentListenerUtil.java
License:Open Source License
/** * @param widget/* w ww .j a v a 2s .co m*/ * @param event * @param listener */ public static void asyncAddListener(final MethodEventSource widget, final Class<? extends Component.Event> event, final Component.Listener listener, Method listenerMethod) { if (widget == null) { return; } UI ui = UI.getCurrent(); if (ui != null) { widget.addListener(event, listener, listenerMethod); } else { throw new IllegalStateException("Not a valid web transaction"); } }