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

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

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

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

相关文章