Package com.google.gwt.dom.client

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


  @Override
  public void onBrowserEvent(Event event) {
    super.onBrowserEvent(event);

    // Find the cell where the event occurred.
    EventTarget eventTarget = event.getEventTarget();
    TableCellElement cell = null;
    if (eventTarget != null && Element.is(eventTarget)) {
      cell = findNearestParentCell(Element.as(eventTarget));
    }
    if (cell == null) {
View Full Code Here


   * @param toElement true to use {@link Event#getRelatedEventTarget()}
   * @return the within state
   */
  public boolean within(Element element, boolean toElement) {
    if (event != null && Element.is(element)) {
      EventTarget target = toElement ? event.getRelatedEventTarget() : event.getEventTarget();
      if (Element.is(target)) {
        return DOM.isOrHasChild(element, (Element) Element.as(target));
      }
    }
    return false;
View Full Code Here

      }
    }
  }

  protected void onMouseOut(ComponentEvent ce) {
    EventTarget to = ce.getEvent().getRelatedEventTarget();
    if (activeItem != null
        && (to == null || (Element.is(to) && !DOM.isOrHasChild(activeItem.getElement(), (Element) Element.as(to))))
        && activeItem.shouldDeactivate(ce)) {
      deactiveActiveItem();
    }
View Full Code Here

      deactiveActiveItem();
    }
  }

  protected void onMouseOver(ComponentEvent ce) {
    EventTarget from = ce.getEvent().getRelatedEventTarget();
    if (from == null || (Element.is(from) && !DOM.isOrHasChild(getElement(), (Element) Element.as(from)))) {
      Component c = findItem(ce.getTarget());
      if (c != null && c instanceof Item) {
        Item item = (Item) c;
        if (activeItem != item && item.canActivate && item.isEnabled()) {
View Full Code Here

      setActiveItem(item, item.expanded);
    }
  }

  protected void onMouseOut(ComponentEvent ce) {
    EventTarget eT = ce.getEvent().getRelatedEventTarget();
    if ((eT == null || (Element.is(eT) && findItem((Element) Element.as(eT)) == null)) && active != null && !active.expanded) {
      onDeactivate(active);
    }
  }
View Full Code Here

          onRowOver(row);
        }
        break;

      case Event.ONMOUSEOVER:
        EventTarget from = ge.getEvent().getRelatedEventTarget();
        if (from == null
            || (Element.is(from) && !DOM.isOrHasChild(grid.getElement(),
                (com.google.gwt.user.client.Element) Element.as(from)))) {
          Element r = getRow(ge.getRowIndex());
          if (r != null) {
            onRowOver(r);
          }
        }
        break;
      case Event.ONMOUSEOUT:
        EventTarget to = ge.getEvent().getRelatedEventTarget();
        if (to == null
            || (Element.is(to) && !DOM.isOrHasChild(grid.getElement(),
                (com.google.gwt.user.client.Element) Element.as(to)))) {
          if (overRow != null) {
            onRowOut(overRow);
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

    }
  }

  protected void onMouseOut(Context context, XElement parent, String currentValue, NativeEvent event,
      ValueUpdater<String> valueUpdater) {
    EventTarget from = event.getEventTarget();
    if (from != null && Element.is(from)) {
      appearance.onMouseOut(parent, Element.as(from), event);
    }
  }
View Full Code Here

    }
  }

  protected void onMouseOver(Context context, XElement parent, String currentValue, NativeEvent event,
      ValueUpdater<String> valueUpdater) {
    EventTarget from = event.getEventTarget();
    if (from != null && Element.is(from)) {
      appearance.onMouseOver(parent, Element.as(from), event);
    }
  }
View Full Code Here

      }
    }
  }

  protected void onMouseOut(Event ce) {
    EventTarget to = ce.getRelatedEventTarget();
    if (activeItem != null && (to == null || (Element.is(to) && !activeItem.getElement().isOrHasChild(Element.as(to))))
        && activeItem.shouldDeactivate(ce)) {
      deactivateActiveItem();
    }
  }
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.