private static void triggerScrollEvent(Element elem) { elem.dispatchEvent(Document.get().createScrollEvent()); }
/** * Dispatch an event to the cell, ensuring that the widget will catch it. * * @param widget the widget that will handle the event * @param target the cell element * @param eventBits the event bits to sink * @param event the event to fire, or null not to fire an event */ private static void dispatchCellEvent(Widget widget, Element target, int eventBits, Event event) { // Make sure that the target is still a child of the widget. We defer the // firing of some events, so its possible that the DOM structure has // changed before we fire the event. if (!widget.getElement().isOrHasChild(target)) { return; } // Temporary listen for events from the cell. The event listener will be // removed in onBrowserEvent(). DOM.setEventListener(target, widget); DOM.sinkEvents(target, eventBits | DOM.getEventsSunk(target)); // Dispatch the event to the cell. if (event != null) { target.dispatchEvent(event); } }
@Override public void execute() { // TODO determine if we need to set additional event properties elem.dispatchEvent(DOMUtil.createTouchEndEvent(bubbles, cancelable, detail, ctrlKey, altKey, shiftKey, metaKey, changedTouches)); } });
@Override public void execute() { // TODO determine if we need to set additional event properties elem.dispatchEvent(Document.get().createMouseUpEvent(detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button)); } });
private static void triggerScrollEvent(Element elem) { elem.dispatchEvent(Document.get().createScrollEvent()); }
private static void triggerScrollEvent(Element elem) { elem.dispatchEvent(Document.get().createScrollEvent()); }
@PatchMethod static void dispatchEvent(Object domImpl, Element target, NativeEvent evt) { EventListener listener = DOM.getEventListener(target); if (listener != null && evt instanceof Event) { listener.onBrowserEvent((Event) evt); } // dispatch to parent if needed boolean propagationStopped = JavaScriptObjects.getBoolean(evt, JsoProperties.EVENT_IS_STOPPED); if (target.getParentElement() != null && propagationStopped) { target.getParentElement().dispatchEvent(evt); } }
@PatchMethod static void dispatchEvent(Object domImpl, Element target, NativeEvent evt) { EventListener listener = DOM.getEventListener(target); if (listener != null && evt instanceof Event) { listener.onBrowserEvent((Event) evt); } // dispatch to parent if needed boolean propagationStopped = JavaScriptObjects.getBoolean(evt, JsoProperties.EVENT_IS_STOPPED); if (target.getParentElement() != null && propagationStopped) { target.getParentElement().dispatchEvent(evt); } }
/** * Dispatch an event to the cell, ensuring that the widget will catch it. * * @param widget the widget that will handle the event * @param target the cell element * @param eventBits the event bits to sink * @param event the event to fire, or null not to fire an event */ private static void dispatchCellEvent(Widget widget, Element target, int eventBits, Event event) { // Make sure that the target is still a child of the widget. We defer the // firing of some events, so its possible that the DOM structure has // changed before we fire the event. if (!widget.getElement().isOrHasChild(target)) { return; } // Temporary listen for events from the cell. The event listener will be // removed in onBrowserEvent(). DOM.setEventListener(target, widget); DOM.sinkEvents(target, eventBits | DOM.getEventsSunk(target)); // Dispatch the event to the cell. if (event != null) { target.dispatchEvent(event); } }
/** * Dispatch an event to the cell, ensuring that the widget will catch it. * * @param widget the widget that will handle the event * @param target the cell element * @param eventBits the event bits to sink * @param event the event to fire, or null not to fire an event */ private static void dispatchCellEvent(Widget widget, Element target, int eventBits, Event event) { // Make sure that the target is still a child of the widget. We defer the // firing of some events, so its possible that the DOM structure has // changed before we fire the event. if (!widget.getElement().isOrHasChild(target)) { return; } // Temporary listen for events from the cell. The event listener will be // removed in onBrowserEvent(). DOM.setEventListener(target, widget); DOM.sinkEvents(target, eventBits | DOM.getEventsSunk(target)); // Dispatch the event to the cell. if (event != null) { target.dispatchEvent(event); } }
public void dispatchEvent(NativeEvent evt, Object[] datas, Function... funcs) { for (Element e : elements()) { if (isEventCapable(e)) { $(e).data(EventsListener.EVENT_DATA, datas); // Ie6-8 don't dispatch bitless event if ((browser.ie6 || browser.ie8) && Event.getTypeInt(evt.getType()) == -1) { bubbleEventForIE(e, evt.<Event> cast()); } else { e.dispatchEvent(evt); } if (!JsUtils.isDefaultPrevented(evt)) { callHandlers(e, evt, funcs); } $(e).removeData(EventsListener.EVENT_DATA); } } }