/** * Called when the user finishes clicking on this button. The default behavior * is to fire the click event to listeners. Subclasses that override * {@link #onClickStart()} should override this method to restore the normal * widget display. */ protected void onClick() { // Allow the click we're about to synthesize to pass through to the // superclass and containing elements. Element.dispatchEvent() is // synchronous, so we simply set and clear the flag within this method. allowClick = true; // Mouse coordinates are not always available (e.g., when the click is // caused by a keyboard event). NativeEvent evt = Document.get().createClickEvent(1, 0, 0, 0, 0, false, false, false, false); getElement().dispatchEvent(evt); allowClick = false; }
/** * Called when the user finishes clicking on this button. The default * behavior is to fire the click event to listeners. Subclasses that * override {@link #onClickStart()} should override this method to restore * the normal widget display. */ protected void onClick() { // Allow the click we're about to synthesize to pass through to the // superclass and containing elements. Element.dispatchEvent() is // synchronous, so we simply set and clear the flag within this method. allowClick = true; // Mouse coordinates are not always available (e.g., when the click is // caused by a keyboard event). NativeEvent evt = Document.get().createClickEvent(1, 0, 0, 0, 0, false, false, false, false); getElement().dispatchEvent(evt); allowClick = false; }
/** * Called when the user finishes clicking on this button. The default behavior * is to fire the click event to listeners. Subclasses that override * {@link #onClickStart()} should override this method to restore the normal * widget display. */ protected void onClick() { // Allow the click we're about to synthesize to pass through to the // superclass and containing elements. Element.dispatchEvent() is // synchronous, so we simply set and clear the flag within this method. allowClick = true; // Mouse coordinates are not always available (e.g., when the click is // caused by a keyboard event). NativeEvent evt = Document.get().createClickEvent(1, 0, 0, 0, 0, false, false, false, false); getElement().dispatchEvent(evt); allowClick = false; }
/** * Called when the user finishes clicking on this button. The default behavior * is to fire the click event to listeners. Subclasses that override * {@link #onClickStart()} should override this method to restore the normal * widget display. */ protected void onClick() { // Allow the click we're about to synthesize to pass through to the // superclass and containing elements. Element.dispatchEvent() is // synchronous, so we simply set and clear the flag within this method. allowClick = true; // Mouse coordinates are not always available (e.g., when the click is // caused by a keyboard event). NativeEvent evt = Document.get().createClickEvent(1, 0, 0, 0, 0, false, false, false, false); getElement().dispatchEvent(evt); allowClick = false; }
public void fireEvent() { prepareEvent(); NativeEvent event = createEvent(el); if (el != null) { el.dispatchEvent(event); } else { //well, probably generated id - bad luck GWT.log("Element was not found for event: " + toString(true, false)); } }
public void onTouchEnd(TouchEndEvent event) { if (touchStarted) { event.preventDefault(); event.stopPropagation(); NativeEvent nativeEvent = event.getNativeEvent(); NativeEvent evt = Document.get().createClickEvent(1, nativeEvent.getScreenX(), nativeEvent.getScreenY(), nativeEvent.getClientX(), nativeEvent.getClientY(), false, false, false, false); getElement().dispatchEvent(evt); touchStarted = false; fastClickAt = new Date(); } }
@Override public void onTouchEnd(TouchEndEvent event) { if (touchStarted) { event.preventDefault(); event.stopPropagation(); NativeEvent nativeEvent = event.getNativeEvent(); NativeEvent evt = Document.get().createClickEvent(1, nativeEvent.getScreenX(), nativeEvent.getScreenY(), nativeEvent.getClientX(), nativeEvent.getClientY(), false, false, false, false); getElement().dispatchEvent(evt); touchStarted = false; fastClickAt = new Date(); } }
public static void loadUrl(String url) { Anchor a = new Anchor("", url); RootLayoutPanel.get().add(a); NativeEvent event = Document.get().createClickEvent(1, 1, 1, 1, 1, false, false, false, false); a.getElement().dispatchEvent(event); RootLayoutPanel.get().remove(a); }
@Override public void onMultiTap(MultiTapEvent event) { if (BrowserInfo.get().isTouchDevice()) { final NativeEvent doubleClickEvent = Document.get().createDblClickEvent( 0, event.getTouchStarts().get(0).get(0).getPageX(), event.getTouchStarts().get(0).get(0).getPageY(), event.getTouchStarts().get(0).get(0).getPageX(), event.getTouchStarts().get(0).get(0).getPageY(), false, false, false, false); getElement().dispatchEvent(doubleClickEvent); } } }, MultiTapEvent.getType());
target.getElement().dispatchEvent(createMouseDownEvent(event)); return null;
target.getElement().dispatchEvent(createMouseDownEvent(event)); return null;