Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.EventTarget


  private boolean eventTargetsPartner(NativeEvent event) {
    if (autoHidePartners == null) {
      return false;
    }

    EventTarget target = event.getEventTarget();
    if (Element.is(target)) {
      for (Element elem : autoHidePartners) {
        if (elem.isOrHasChild(Element.as(target))) {
          return true;
        }
View Full Code Here


   *
   * @param event the native event
   * @return true if the event targets the popup
   */
  private boolean eventTargetsPopup(NativeEvent event) {
    EventTarget target = event.getEventTarget();
    if (Element.is(target)) {
      return getElement().isOrHasChild(Element.as(target));
    }
    return false;
  }
View Full Code Here

          switch (event.getTypeInt()) {
            case Event.ONMOUSEDOWN:
              // If the event target is part of the parent menu, suppress the
              // event altogether.
              EventTarget target = event.getNativeEvent().getEventTarget();
              Element parentMenuElement = item.getParentMenu().getElement();
              if (parentMenuElement.isOrHasChild(Element.as(target))) {
                event.cancel();
                return;
              }
View Full Code Here

      SurfaceView.this.select(this);
      if (!note.isOwnedByCurrentUser()) {
        return;
      }

      final EventTarget target = event.getNativeEvent().getEventTarget();
      assert Element.is(target);
      if (!Element.is(target)) {
        return;
      }
View Full Code Here

                            switch (typeInt) {
                            case Event.ONMOUSEOVER:
                                if (dragElement == null) {
                                    break;
                                }
                                EventTarget currentEventTarget = event
                                        .getNativeEvent()
                                        .getCurrentEventTarget();
                                if (Node.is(currentEventTarget)
                                        && !dragElement.isOrHasChild(Node
                                                .as(currentEventTarget))) {
                                    // drag image appeared below, ignore
                                    break;
                                }
                            case Event.ONKEYDOWN:
                            case Event.ONKEYPRESS:
                            case Event.ONKEYUP:
                            case Event.ONBLUR:
                            case Event.ONFOCUS:
                                // don't cancel possible drag start
                                break;
                            case Event.ONMOUSEOUT:

                                if (dragElement == null) {
                                    break;
                                }
                                EventTarget relatedEventTarget = event
                                        .getNativeEvent()
                                        .getRelatedEventTarget();
                                if (Node.is(relatedEventTarget)
                                        && !dragElement.isOrHasChild(Node
                                                .as(relatedEventTarget))) {
View Full Code Here

    title = null;
  }

  @Override
  protected void onTargetOut(ComponentEvent ce) {
    EventTarget to = ce.getEvent().getRelatedEventTarget();
    if (to == null || (to != null && !DOM.isOrHasChild(target.getElement(), (Element) Element.as(to)))) {
      super.onTargetOut(ce);
    }
  }
View Full Code Here

      listener = new Listener<ComponentEvent>() {
        public void handleEvent(ComponentEvent be) {
          Element source = target.getElement();
          EventType type = be.getType();
          if (type == Events.OnMouseOver) {
            EventTarget from = be.getEvent().getRelatedEventTarget();
            if (from == null || (from != null && !DOM.isOrHasChild(source, (Element) Element.as(from)))) {
              onTargetOver(be);
            }
          } else if (type == Events.OnMouseOut) {
            EventTarget to = be.getEvent().getRelatedEventTarget();
            if (to == null || (to != null && !DOM.isOrHasChild(source, (Element) Element.as(to)))) {
              onTargetOut(be);
            }
          } else if (type == Events.OnMouseMove) {
            onMouseMove(be);
View Full Code Here

    onTargetOver(event.getNativeEvent().<Event> cast());
  }

  @Override
  protected void onTargetOut(Event ce) {
    EventTarget to = ce.getRelatedEventTarget();
    if (to == null
        || (Element.is(target.getElement()) && Element.is(to) && !DOM.isOrHasChild(target.getElement(),
            (Element) Element.as(to)))) {
      super.onTargetOut(ce);
    }
View Full Code Here

    }
  }

  protected void onTargetMouseOver(MouseOverEvent event) {
    Element source = event.getNativeEvent().getEventTarget().cast();
    EventTarget from = event.getNativeEvent().getRelatedEventTarget();
    if (from == null || !source.isOrHasChild(from.<Element> cast())) {
      onTargetOver(event.getNativeEvent().<Event> cast());
    }
  }
View Full Code Here

    return new int[] {first, last};
  }

  protected void handleEventForCell(Event event) {
    // Get the event target.
    EventTarget eventTarget = event.getEventTarget();
    if (cell == null || !Element.is(eventTarget)) {
      return;
    }
    final Element target = event.getEventTarget().cast();
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.EventTarget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.