Search in sources :

Example 16 with EventTarget

use of com.google.gwt.dom.client.EventTarget in project GwtMobile by dennisjzh.

the class DragControllerMobile method onTouchStart.

public void onTouchStart(TouchEvent e) {
    EventTarget target = e.getEventTarget();
    boolean preventDefault = true;
    if (Element.is(target)) {
        Element ele = Element.as(target);
        // INPUT element will not get focus if default action is prevented.
        if (Utils.isHtmlFormControl(ele)) {
            ele.focus();
            preventDefault = false;
        }
    }
    if (preventDefault) {
        // prevent default action of selecting text
        e.preventDefault();
        e.stopPropagation();
    }
    // FIXME: for multi-touch platforms.
    onStart(e, new Point(e.touches().get(0).getClientX(), e.touches().get(0).getClientY()));
}
Also used : Element(com.google.gwt.dom.client.Element) Point(com.gwtmobile.ui.client.utils.Point) EventTarget(com.google.gwt.dom.client.EventTarget)

Aggregations

EventTarget (com.google.gwt.dom.client.EventTarget)16 Element (com.google.gwt.dom.client.Element)11 Point (com.gwtmobile.ui.client.utils.Point)4 NativeEvent (com.google.gwt.dom.client.NativeEvent)3 Node (com.google.gwt.dom.client.Node)2 TableCellElement (com.google.gwt.dom.client.TableCellElement)2 TableRowElement (com.google.gwt.dom.client.TableRowElement)2 TableSectionElement (com.google.gwt.dom.client.TableSectionElement)2 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 NodeDragMoveEvent (com.ait.lienzo.client.core.event.NodeDragMoveEvent)1 NodeDragMoveHandler (com.ait.lienzo.client.core.event.NodeDragMoveHandler)1 Point2D (com.ait.lienzo.client.core.types.Point2D)1 Context (com.google.gwt.cell.client.Cell.Context)1 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)1 ButtonElement (com.google.gwt.dom.client.ButtonElement)1 DivElement (com.google.gwt.dom.client.DivElement)1 LIElement (com.google.gwt.dom.client.LIElement)1 Style (com.google.gwt.dom.client.Style)1 TableElement (com.google.gwt.dom.client.TableElement)1