Example usage for com.google.gwt.event.dom.client DomEvent getRelativeElement

List of usage examples for com.google.gwt.event.dom.client DomEvent getRelativeElement

Introduction

In this page you can find the example usage for com.google.gwt.event.dom.client DomEvent getRelativeElement.

Prototype

public final Element getRelativeElement() 

Source Link

Document

Gets the element relative to which event coordinates will be measured.

Usage

From source file:info.magnolia.ui.vaadin.gwt.client.touchwidget.GwtTouchEventConverter.java

License:Open Source License

@SuppressWarnings("unchecked")
public static <T extends TouchEvent<?>> T convertGWTEvent(DomEvent<?> gwtEvent) {
    if (map.containsKey(gwtEvent.getClass())) {
        final T result = (T) map.get(gwtEvent.getClass());
        result.setNativeEvent(gwtEvent.getNativeEvent());
        result.setRelativeElement(gwtEvent.getRelativeElement());
        return result;
    }/*from   w w w  .  j  a va  2 s . co  m*/
    return null;
}

From source file:org.uberfire.ext.wires.core.grids.client.util.CoordinateUtilities.java

License:Apache License

public static int getRelativeXOfEvent(final DomEvent event) {
    final NativeEvent e = event.getNativeEvent();
    final Element target = event.getRelativeElement();
    return e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft()
            + target.getOwnerDocument().getScrollLeft();
}

From source file:org.uberfire.ext.wires.core.grids.client.util.CoordinateUtilities.java

License:Apache License

public static int getRelativeYOfEvent(final DomEvent event) {
    final NativeEvent e = event.getNativeEvent();
    final Element target = event.getRelativeElement();
    return e.getClientY() - target.getAbsoluteTop() + target.getScrollTop()
            + target.getOwnerDocument().getScrollTop();
}

From source file:stroom.menubar.client.presenter.MenubarPresenter.java

License:Apache License

private void showPopup(final MenuItem menuItem, final DomEvent<?> event) {
    final int x = event.getRelativeElement().getAbsoluteLeft();
    final int y = event.getRelativeElement().getAbsoluteBottom();
    final Element element = event.getRelativeElement();
    showPopup(menuItem, x, y, element);//www.j a  v a2  s  .c  o m
}