当前位置: 首页>>代码示例>>Java>>正文


Java DOM.eventGetTarget方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.DOM.eventGetTarget方法的典型用法代码示例。如果您正苦于以下问题:Java DOM.eventGetTarget方法的具体用法?Java DOM.eventGetTarget怎么用?Java DOM.eventGetTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.DOM的用法示例。


在下文中一共展示了DOM.eventGetTarget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
@Override
public void onBrowserEvent(Event event) {
   	Element target = DOM.eventGetTarget(event);

    switch (DOM.eventGetType(event)) {
    case Event.ONMOUSEDOWN:
    	boolean open = iFilterOpen.getElement().equals(target);
    	boolean close = iFilterClose.getElement().equals(target);
    	boolean clear = iFilterClear.getElement().equals(target);
    	boolean filter = iFilter.getElement().equals(target);
    	if (isFilterPopupShowing() || close) {
    		hideFilterPopup();
    	} else if (open) {
    		hideSuggestions();
    		showFilterPopup();
    	}
    	if (clear) {
			iFilter.setText("");
			removeAllChips();
			setAriaLabel(toAriaString());
			ValueChangeEvent.fire(FilterBox.this, getValue());
    	}
    	if (!filter) {
			event.stopPropagation();
			event.preventDefault();
	    	Scheduler.get().scheduleDeferred(new ScheduledCommand() {
				@Override
				public void execute() {
					iFilter.setFocus(true);
				}
			});
    	}
    	break;
    }
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:36,代码来源:FilterBox.java

示例2: onEventPreview

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
@Override
public boolean onEventPreview(Event event) {
  // Always allow event if capturing is enabled
  if (DOM.getCaptureElement() != null) {
    return true;
  }

  // If this is a modal wizard then only allow it if the target element is a child of this wizard
  if (modal) {
    Element target = DOM.eventGetTarget(event);
    return (target != null && DOM.isOrHasChild(getElement(), target));
  } else {
    return super.onEventPreview(event);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:16,代码来源:Wizard.java

示例3: onBrowserEvent

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public void onBrowserEvent(Event event) {
	if (iDummy) return;
    Element target = DOM.eventGetTarget(event);
    boolean anchor = false;
    for (; target != null; target = DOM.getParent(target)) {
    	String tag = target.getPropertyString("tagName");
    	if ("a".equalsIgnoreCase(tag)) {
    		anchor = true;
    		break;
    	} else if ("div".equalsIgnoreCase(tag)) {
    		break;
    	}
    }
	EventTarget related = event.getRelatedEventTarget();
    switch (DOM.eventGetType(event)) {
	case Event.ONCLICK:
		select(false);
		if (!anchor) {
			MeetingClickEvent e = new MeetingClickEvent(Meeting.this);
			for (MeetingClickHandler h: iMeetingClickHandlers)
				h.onMeetingClick(e);
		}
		break;
	case Event.ONMOUSEOVER:
        if (related == null || !getElement().isOrHasChild((Element)related.cast())) {
			select(true);
        }
		break;
	case Event.ONMOUSEOUT:
        if (related == null || !getElement().isOrHasChild((Element)related.cast())) {
        	select(false);
        }
		break;
	case Event.ONMOUSEMOVE:
		int relativeX = event.getClientX() - getElement().getAbsoluteLeft() + getElement().getScrollLeft() + getElement().getOwnerDocument().getScrollLeft();
		if (relativeX < iLeft - 6 - getDay() * iCellWidth || relativeX > iLeft - 2 - getDay() * iCellWidth + iWidth) {
			select(false);
		}
		break;
	}
    super.onBrowserEvent(event);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:43,代码来源:TimeGrid.java


注:本文中的com.google.gwt.user.client.DOM.eventGetTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。