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