com.google.gwt.user.client.Event.getRelatedEventTarget()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中com.google.gwt.user.client.Event.getRelatedEventTarget()方法的一些代码示例,展示了Event.getRelatedEventTarget()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getRelatedEventTarget()方法的具体详情如下:
包路径:com.google.gwt.user.client.Event
类名称:Event
方法名:getRelatedEventTarget

Event.getRelatedEventTarget介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Gets the related target for this event.
 * 
 * @return the related target
 * @deprecated use {@link NativeEvent#getRelatedEventTarget()} instead
 */
@Deprecated
public final Element getRelatedTarget() {
 return getRelatedEventTarget().cast();
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public Element eventGetToElement(Event evt) {
 if (evt.getType().equals(BrowserEvents.MOUSEOVER)) {
  return evt.getEventTarget().cast();
 }
 if (evt.getType().equals(BrowserEvents.MOUSEOUT)) {
  return evt.getRelatedEventTarget().cast();
 }
 return null;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public Element eventGetFromElement(Event evt) {
 if (evt.getType().equals(BrowserEvents.MOUSEOVER)) {
  return evt.getRelatedEventTarget().cast();
 }
 if (evt.getType().equals(BrowserEvents.MOUSEOUT)) {
  return evt.getEventTarget().cast();
 }
 return null;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

public void onBrowserEvent(Event event) {
 switch (DOM.eventGetType(event)) {
  case Event.ONMOUSEOVER:
   // Only fire the mouse over event if it's coming from outside this
   // widget.
  case Event.ONMOUSEOUT:
   // Only fire the mouse out event if it's leaving this
   // widget.
   Element related = event.getRelatedEventTarget().cast();
   if (related != null && getElement().isOrHasChild(related)) {
    return;
   }
   break;
 }
 DomEvent.fireNativeEvent(event, this, this.getElement());
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Gets the related target for this event.
 * 
 * @return the related target
 * @deprecated use {@link NativeEvent#getRelatedEventTarget()} instead
 */
@Deprecated
public final Element getRelatedTarget() {
 return getRelatedEventTarget().cast();
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Gets the related target for this event.
 * 
 * @return the related target
 * @deprecated use {@link NativeEvent#getRelatedEventTarget()} instead
 */
@Deprecated
public final Element getRelatedTarget() {
 return getRelatedEventTarget().cast();
}

代码示例来源:origin: net.wetheinter/gwt-user

@Override
public Element eventGetToElement(Event evt) {
 if (evt.getType().equals(BrowserEvents.MOUSEOVER)) {
  return evt.getEventTarget().cast();
 }
 if (evt.getType().equals(BrowserEvents.MOUSEOUT)) {
  return evt.getRelatedEventTarget().cast();
 }
 return null;
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

@Override
public Element eventGetFromElement(Event evt) {
 if (evt.getType().equals(BrowserEvents.MOUSEOVER)) {
  return evt.getRelatedEventTarget().cast();
 }
 if (evt.getType().equals(BrowserEvents.MOUSEOUT)) {
  return evt.getEventTarget().cast();
 }
 return null;
}

代码示例来源:origin: net.wetheinter/gwt-user

@Override
public Element eventGetFromElement(Event evt) {
 if (evt.getType().equals(BrowserEvents.MOUSEOVER)) {
  return evt.getRelatedEventTarget().cast();
 }
 if (evt.getType().equals(BrowserEvents.MOUSEOUT)) {
  return evt.getEventTarget().cast();
 }
 return null;
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

@Override
public Element eventGetToElement(Event evt) {
 if (evt.getType().equals(BrowserEvents.MOUSEOVER)) {
  return evt.getEventTarget().cast();
 }
 if (evt.getType().equals(BrowserEvents.MOUSEOUT)) {
  return evt.getRelatedEventTarget().cast();
 }
 return null;
}

代码示例来源:origin: com.extjs/gxt

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);
 }
}

代码示例来源:origin: com.googlecode.gwtquery/gwtquery

public boolean f(Event e, Object... arg) {
  EventTarget eventTarget = e.getCurrentEventTarget();
  Element target = eventTarget != null ? eventTarget.<Element> cast() : null;
  EventTarget relatedEventTarget = e.getRelatedEventTarget();
  Element related = relatedEventTarget != null ? relatedEventTarget.<Element> cast() : null;
  if (related == null || (related != target && !GQuery.contains(target, related))) {
   getInstance(target).dispatchEvent(e, type);
  }
  return true;
 };
};

代码示例来源:origin: com.extjs/gxt

/**
  * Returns <code>true</code> if the target of this event equals or is a child
  * of the given element.
  * 
  * @param element the element
  * @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;
 }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

public void onBrowserEvent(Event event) {
 switch (DOM.eventGetType(event)) {
  case Event.ONMOUSEOVER:
   // Only fire the mouse over event if it's coming from outside this
   // widget.
  case Event.ONMOUSEOUT:
   // Only fire the mouse out event if it's leaving this
   // widget.
   Element related = event.getRelatedEventTarget().cast();
   if (related != null && getElement().isOrHasChild(related)) {
    return;
   }
   break;
 }
 DomEvent.fireNativeEvent(event, this, this.getElement());
}

代码示例来源:origin: net.wetheinter/gwt-user

public void onBrowserEvent(Event event) {
 switch (DOM.eventGetType(event)) {
  case Event.ONMOUSEOVER:
   // Only fire the mouse over event if it's coming from outside this
   // widget.
  case Event.ONMOUSEOUT:
   // Only fire the mouse out event if it's leaving this
   // widget.
   Element related = event.getRelatedEventTarget().cast();
   if (related != null && getElement().isOrHasChild(related)) {
    return;
   }
   break;
 }
 DomEvent.fireNativeEvent(event, this, this.getElement());
}

代码示例来源:origin: com.extjs/gxt

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();
 }
}

代码示例来源:origin: com.extjs/gxt

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

代码示例来源:origin: com.extjs/gxt

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()) {
    setActiveItem(item, true);
   }
  }
 }
}

代码示例来源:origin: bedatadriven/activityinfo

EventTarget from = ge.getEvent().getRelatedEventTarget();
if (from == null || (Element.is(from) && !grid.getElement().isOrHasChild(Element.as(from)))) {
  cell = getCell(ge.getRowIndex(), ge.getColIndex());
EventTarget to = ge.getEvent().getRelatedEventTarget();
if (to == null || (Element.is(to) && !grid.getElement().isOrHasChild(Element.as(to)))) {
  if (overCell != null) {

代码示例来源:origin: com.extjs/gxt

EventType type = be.getType();
if (type == Events.OnMouseOver) {
 EventTarget from = be.getEvent().getRelatedEventTarget();
 if (from == null
   || (Element.is(source) && Element.is(from) && !DOM.isOrHasChild(source, (Element) Element.as(from)))) {
 EventTarget to = be.getEvent().getRelatedEventTarget();
 if (to == null
   || (Element.is(source) && Element.is(to) && !DOM.isOrHasChild(source, (Element) Element.as(to)))) {

相关文章