本文整理了Java中com.google.gwt.user.client.Event.fireNativePreviewEvent()
方法的一些代码示例,展示了Event.fireNativePreviewEvent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.fireNativePreviewEvent()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Event
类名称:Event
方法名:fireNativePreviewEvent
[英]Fire a NativePreviewEvent for the native event.
[中]为本机事件触发NativePreviewEvent。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* This method is called directly by native code when event preview is being
* used.
*
* @param evt a handle to the event being previewed
* @return <code>false</code> to cancel the event
*/
public static boolean previewEvent(Event evt) {
// Fire a NativePreviewEvent to NativePreviewHandlers
boolean ret = Event.fireNativePreviewEvent(evt);
// If the preview cancels the event, stop it from bubbling and performing
// its default action. Check for a null evt to allow unit tests to run.
if (!ret && evt != null) {
evt.stopPropagation();
evt.preventDefault();
}
return ret;
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
public static void triggerNativeEvent(NativeEvent event, Element target) {
// only trigger native event if the effective event target (setup in Browser) is the same as
// the target, in order to avoid triggering nativePreviewHandler while bubbling
Element effectiveTarget = JavaScriptObjects.getObject(event, JsoProperties.EVENT_TARGET);
if (effectiveTarget == target) {
Event.fireNativePreviewEvent(event);
}
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
public static void triggerNativeEvent(NativeEvent event, Element target) {
// only trigger native event if the effective event target (setup in Browser) is the same as
// the target, in order to avoid triggering nativePreviewHandler while bubbling
Element effectiveTarget = JavaScriptObjects.getObject(event, JsoProperties.EVENT_TARGET);
if (effectiveTarget == target) {
Event.fireNativePreviewEvent(event);
}
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* This method is called directly by native code when event preview is being
* used.
*
* @param evt a handle to the event being previewed
* @return <code>false</code> to cancel the event
*/
public static boolean previewEvent(Event evt) {
// Fire a NativePreviewEvent to NativePreviewHandlers
boolean ret = Event.fireNativePreviewEvent(evt);
// If the preview cancels the event, stop it from bubbling and performing
// its default action. Check for a null evt to allow unit tests to run.
if (!ret && evt != null) {
evt.stopPropagation();
evt.preventDefault();
}
return ret;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* This method is called directly by native code when event preview is being
* used.
*
* @param evt a handle to the event being previewed
* @return <code>false</code> to cancel the event
*/
public static boolean previewEvent(Event evt) {
// Fire a NativePreviewEvent to NativePreviewHandlers
boolean ret = Event.fireNativePreviewEvent(evt);
// If the preview cancels the event, stop it from bubbling and performing
// its default action. Check for a null evt to allow unit tests to run.
if (!ret && evt != null) {
evt.stopPropagation();
evt.preventDefault();
}
return ret;
}
内容来源于网络,如有侵权,请联系作者删除!