return isTouchEvent(Event.as(event));
}
public static void simulateClickFromTouchEvent(Event touchevent,
Widget widget) {
Touch touch = touchevent.getChangedTouches().get(0);
final NativeEvent createMouseUpEvent = Document.get()
.createMouseUpEvent(0, touch.getScreenX(), touch.getScreenY(),
touch.getClientX(), touch.getClientY(), false, false,
false, false, NativeEvent.BUTTON_LEFT);
final NativeEvent createMouseDownEvent = Document.get()
.createMouseDownEvent(0, touch.getScreenX(),
touch.getScreenY(), touch.getClientX(),
touch.getClientY(), false, false, false, false,
NativeEvent.BUTTON_LEFT);
final NativeEvent createMouseClickEvent = Document.get()
.createClickEvent(0, touch.getScreenX(), touch.getScreenY(),
touch.getClientX(), touch.getClientY(), false, false,
false, false);
/*
* Get target with element from point as we want the actual element, not
* the one that sunk the event.
*/
final Element target = getElementFromPoint(touch.getClientX(),
touch.getClientY());
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
try {
target.dispatchEvent(createMouseDownEvent);
target.dispatchEvent(createMouseUpEvent);