/** * Fires a before selection event on all registered handlers in the handler * manager. If no such handlers exist, this method will do nothing. * * @param <T> the item type * @param source the source of the handlers * @param item the item * @return the event so that the caller can check if it was canceled, or null * if no handlers of this event type have been registered */ public static <T> BeforeSelectionEvent<T> fire( HasBeforeSelectionHandlers<T> source, T item) { // If no handlers exist, then type can be null. if (TYPE != null) { BeforeSelectionEvent<T> event = new BeforeSelectionEvent<T>(); event.setItem(item); source.fireEvent(event); return event; } return null; }
public static <T> Observable<BeforeSelectionEvent<T>> beforeSelection(HasBeforeSelectionHandlers<T> source) { return Observable.create(s -> register(s, source.addBeforeSelectionHandler(s::onNext)), uiBackpressureMode()); }
public static <T> Observable<BeforeSelectionEvent<T>> beforeSelection(HasBeforeSelectionHandlers<T> source) { return Observable.create(s -> register(s, source.addBeforeSelectionHandler(s::onNext))); }
/** * Fires a before selection event on all registered handlers in the handler * manager. If no such handlers exist, this method will do nothing. * * @param <T> the item type * @param source the source of the handlers * @param item the item * @return the event so that the caller can check if it was canceled, or null * if no handlers of this event type have been registered */ public static <T> BeforeSelectionEvent<T> fire( HasBeforeSelectionHandlers<T> source, T item) { // If no handlers exist, then type can be null. if (TYPE != null) { BeforeSelectionEvent<T> event = new BeforeSelectionEvent<T>(); event.setItem(item); source.fireEvent(event); return event; } return null; }
/** * Fires a before selection event on all registered handlers in the handler * manager. If no such handlers exist, this method will do nothing. * * @param <T> the item type * @param source the source of the handlers * @param item the item * @return the event so that the caller can check if it was canceled, or null * if no handlers of this event type have been registered */ public static <T> BeforeSelectionEvent<T> fire( HasBeforeSelectionHandlers<T> source, T item) { // If no handlers exist, then type can be null. if (TYPE != null) { BeforeSelectionEvent<T> event = new BeforeSelectionEvent<T>(); event.setItem(item); source.fireEvent(event); return event; } return null; }