Package com.google.gwt.dom.client

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


   * @param event
   *            The mouse event itself.
   * @return Returns the DOM element or null if something went wrong.
   */
  public static Element getTarget(DomEvent<?> event) {
    EventTarget target = event.getNativeEvent().getEventTarget();
    if (Element.is(target)) {
      return Element.as(target);
    }
    return null;
  }
View Full Code Here


    Coordinate coordinate = new Coordinate(event.getX(), event.getY());
    return mapPresenter.getViewPort().transform(coordinate, RenderSpace.SCREEN, RenderSpace.WORLD);
  }

  protected Element getTarget(MouseEvent<?> event) {
    EventTarget target = event.getNativeEvent().getEventTarget();
    if (Element.is(target)) {
      return Element.as(target);
    }
    return null;
  }
View Full Code Here

          if (DOM.getEventListener((com.google.gwt.user.client.Element)docElement) == null) {
            principleEventListener = true;
              DOM.setEventListener((com.google.gwt.user.client.Element) docElement, new EventListener() {
                  public void onBrowserEvent(Event event) {
 
                      EventTarget eTarget = event.getEventTarget();
                      Node eventNode;
                      if (Node.is(eTarget)) {
                        eventNode = Node.as(eTarget);                  
                      } else {
                        eventNode = Node.as(getCorrespondingSVGElement(eTarget));
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

                // - calendar must not be in read-only mode
                weekGrid.eventMoved(this);
            } else if (!weekGrid.getCalendar().isDisabled()) {
                // Event Click:
                // - calendar must be enabled (read-only is allowed)
                EventTarget et = event.getNativeEvent().getEventTarget();
                Element e = Element.as(et);
                if (e == caption || e == eventContent
                        || e.getParentElement() == caption) {
                    if (weekGrid.getCalendar().getEventClickListener() != null) {
                        weekGrid.getCalendar().getEventClickListener()
View Full Code Here

            Allow clicks on lhs titles to open thr tree
        */

        addMouseDownHandler(new MouseDownHandler() {
            public void onMouseDown(MouseDownEvent event) {
                EventTarget target = event.getNativeEvent().getEventTarget();
                com.google.gwt.dom.client.Element el = Element.as(target);
                final String title = el.getInnerText();

                if(el.getTagName().equalsIgnoreCase("div"))
                {
View Full Code Here

    protected void onBrowserEvent2(Event event) {
        super.onBrowserEvent2(event);

        if(rowOverHandler!=null)
        {
            EventTarget eventTarget = event.getEventTarget();
            String eventType = event.getType();

            if("mouseover".equals(eventType))
            {
                if (!com.google.gwt.dom.client.Element.is(eventTarget)) {
View Full Code Here

      setActiveItem(item, true, true);
    }
  }

  protected void onMouseOut(Event event) {
    EventTarget eventTarget = event.getEventTarget();
    if ((eventTarget == null || (Element.is(eventTarget) && findWidget((Element) Element.as(eventTarget)) == null))
        && active != null && !active.expanded) {
      onDeactivate(active);
    }
  }
View Full Code Here

      onDeactivate(active);
    }
  }

  protected void onMouseOver(Event event) {
    EventTarget eventTarget = event.getEventTarget();
    if (eventTarget != null) {
      Element element = eventTarget.<Element> cast();
      if (element != null) {
        MenuBarItem item = (MenuBarItem) findWidget(element);
        if (item != null && item != active) {
          setActiveItem(item, active != null && active.expanded, false);
        }
View Full Code Here

  protected void onClick(Context context, XElement parent, String currentValue, NativeEvent event,
      ValueUpdater<String> valueUpdater) {
    event.preventDefault();
    // if (!disabled) {

    EventTarget from = event.getEventTarget();
    if (from != null && Element.is(from)) {
      String color = appearance.getClickedColor(parent, Element.as(from));
      if (color != null) {
        select(parent, context, color, currentValue, valueUpdater);
      }
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.