本文整理了Java中com.google.gwt.user.client.Event.getEventListener()
方法的一些代码示例,展示了Event.getEventListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getEventListener()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Event
类名称:Event
方法名:getEventListener
[英]Gets the EventListener that will receive events for the given element. Only one such listener may exist for a single element.
[中]获取将接收给定元素事件的EventListener。单个元素只能存在一个这样的侦听器。
代码示例来源:origin: com.google.gwt/gwt-servlet
private static boolean isElementChildOfWidget(Element element) {
// Walk up the DOM hierarchy, looking for any widget with an event listener
// set. Though it is not dependable in the general case that a widget will
// have set its element's event listener at all times, it *is* dependable
// if the widget is attached. Which it will be in this case.
element = element.getParentElement();
BodyElement body = Document.get().getBody();
while ((element != null) && (body != element)) {
if (Event.getEventListener(element) != null) {
return true;
}
element = element.getParentElement().cast();
}
return false;
}
代码示例来源:origin: net.wetheinter/gwt-user
private static boolean isElementChildOfWidget(Element element) {
// Walk up the DOM hierarchy, looking for any widget with an event listener
// set. Though it is not dependable in the general case that a widget will
// have set its element's event listener at all times, it *is* dependable
// if the widget is attached. Which it will be in this case.
element = element.getParentElement();
BodyElement body = Document.get().getBody();
while ((element != null) && (body != element)) {
if (Event.getEventListener(element) != null) {
return true;
}
element = element.getParentElement().cast();
}
return false;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private static boolean isElementChildOfWidget(Element element) {
// Walk up the DOM hierarchy, looking for any widget with an event listener
// set. Though it is not dependable in the general case that a widget will
// have set its element's event listener at all times, it *is* dependable
// if the widget is attached. Which it will be in this case.
element = element.getParentElement();
BodyElement body = Document.get().getBody();
while ((element != null) && (body != element)) {
if (Event.getEventListener(element) != null) {
return true;
}
element = element.getParentElement().cast();
}
return false;
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static boolean isElementChildOfWidget(Element element) {
// Walk up the DOM hierarchy, looking for any widget with an event
// listener
// set. Though it is not dependable in the general case that a widget will
// have set its element's event listener at all times, it *is* dependable
// if the widget is attached. Which it will be in this case.
element = element.getParentElement();
BodyElement body = Document.get().getBody();
while (element != null && body != element) {
if (Event.getEventListener(element) != null) {
return true;
}
element = element.getParentElement();
}
return false;
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
@PatchMethod
static boolean isElementChildOfWidget(Element element) {
// Walk up the DOM hierarchy, looking for any widget with an event
// listener
// set. Though it is not dependable in the general case that a widget will
// have set its element's event listener at all times, it *is* dependable
// if the widget is attached. Which it will be in this case.
element = element.getParentElement();
BodyElement body = Document.get().getBody();
while (element != null && body != element) {
if (Event.getEventListener(element) != null) {
return true;
}
element = element.getParentElement();
}
return false;
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
private static Widget getFirstParentWidget(Widget w) {
Element e = w.getElement().getParentElement();
BodyElement body = Document.get().getBody();
while ((e != null) && (body != e)) {
if (Event.getEventListener(e) != null) {
Widget p = $(e).widget();
if (p != null) {
return p;
}
}
e = e.getParentElement();
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!