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

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

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

Element.dispatchEvent介绍

暂无

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Called when the user finishes clicking on this button. The default behavior
 * is to fire the click event to listeners. Subclasses that override
 * {@link #onClickStart()} should override this method to restore the normal
 * widget display.
 */
protected void onClick() {
 // Allow the click we're about to synthesize to pass through to the
 // superclass and containing elements. Element.dispatchEvent() is
 // synchronous, so we simply set and clear the flag within this method.
 allowClick = true;
 // Mouse coordinates are not always available (e.g., when the click is
 // caused by a keyboard event).
 NativeEvent evt = Document.get().createClickEvent(1, 0, 0, 0, 0, false,
   false, false, false);
 getElement().dispatchEvent(evt);
 allowClick = false;
}

代码示例来源:origin: geogebra/geogebra

/**
 * Called when the user finishes clicking on this button. The default
 * behavior is to fire the click event to listeners. Subclasses that
 * override {@link #onClickStart()} should override this method to restore
 * the normal widget display.
 */
protected void onClick() {
  // Allow the click we're about to synthesize to pass through to the
  // superclass and containing elements. Element.dispatchEvent() is
  // synchronous, so we simply set and clear the flag within this method.
  allowClick = true;
  // Mouse coordinates are not always available (e.g., when the click is
  // caused by a keyboard event).
  NativeEvent evt = Document.get().createClickEvent(1, 0, 0, 0, 0, false,
      false, false, false);
  getElement().dispatchEvent(evt);
  allowClick = false;
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Called when the user finishes clicking on this button. The default behavior
 * is to fire the click event to listeners. Subclasses that override
 * {@link #onClickStart()} should override this method to restore the normal
 * widget display.
 */
protected void onClick() {
 // Allow the click we're about to synthesize to pass through to the
 // superclass and containing elements. Element.dispatchEvent() is
 // synchronous, so we simply set and clear the flag within this method.
 allowClick = true;
 // Mouse coordinates are not always available (e.g., when the click is
 // caused by a keyboard event).
 NativeEvent evt = Document.get().createClickEvent(1, 0, 0, 0, 0, false,
   false, false, false);
 getElement().dispatchEvent(evt);
 allowClick = false;
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Called when the user finishes clicking on this button. The default behavior
 * is to fire the click event to listeners. Subclasses that override
 * {@link #onClickStart()} should override this method to restore the normal
 * widget display.
 */
protected void onClick() {
 // Allow the click we're about to synthesize to pass through to the
 // superclass and containing elements. Element.dispatchEvent() is
 // synchronous, so we simply set and clear the flag within this method.
 allowClick = true;
 // Mouse coordinates are not always available (e.g., when the click is
 // caused by a keyboard event).
 NativeEvent evt = Document.get().createClickEvent(1, 0, 0, 0, 0, false,
   false, false, false);
 getElement().dispatchEvent(evt);
 allowClick = false;
}

代码示例来源:origin: sk.seges.acris/acris-recorder-client-core

public void fireEvent() {
  prepareEvent();
  NativeEvent event = createEvent(el);
  if (el != null) {
    el.dispatchEvent(event);
  } else {
    //well, probably generated id - bad luck
    GWT.log("Element was not found for event: " + toString(true, false));
  }
}

代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl

public void onTouchEnd(TouchEndEvent event) {
  if (touchStarted) {
    event.preventDefault();
    event.stopPropagation();
    NativeEvent nativeEvent = event.getNativeEvent();
    NativeEvent evt = Document.get().createClickEvent(1,
        nativeEvent.getScreenX(), nativeEvent.getScreenY(),
        nativeEvent.getClientX(), nativeEvent.getClientY(), false,
        false, false, false);
    getElement().dispatchEvent(evt);
    touchStarted = false;
    fastClickAt = new Date();
  }
}

代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl

@Override
public void onTouchEnd(TouchEndEvent event) {
  if (touchStarted) {
    event.preventDefault();
    event.stopPropagation();
    NativeEvent nativeEvent = event.getNativeEvent();
    NativeEvent evt = Document.get().createClickEvent(1,
        nativeEvent.getScreenX(), nativeEvent.getScreenY(),
        nativeEvent.getClientX(), nativeEvent.getClientY(), false,
        false, false, false);
    getElement().dispatchEvent(evt);
    touchStarted = false;
    fastClickAt = new Date();
  }
}

代码示例来源:origin: dennisjzh/GwtMobile-UI

public static void loadUrl(String url) {
  Anchor a = new Anchor("", url);
  RootLayoutPanel.get().add(a);
  NativeEvent event = Document.get().createClickEvent(1, 1, 1, 1, 1, false, false, false, false);
  a.getElement().dispatchEvent(event);
  RootLayoutPanel.get().remove(a);
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets

@Override
  public void onMultiTap(MultiTapEvent event) {
    if (BrowserInfo.get().isTouchDevice()) {
      final NativeEvent doubleClickEvent =
          Document.get().createDblClickEvent(
              0,
              event.getTouchStarts().get(0).get(0).getPageX(),
              event.getTouchStarts().get(0).get(0).getPageY(),
              event.getTouchStarts().get(0).get(0).getPageX(),
              event.getTouchStarts().get(0).get(0).getPageY(),
              false,
              false,
              false,
              false);
      getElement().dispatchEvent(doubleClickEvent);
    }
  }
}, MultiTapEvent.getType());

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

target.getElement().dispatchEvent(createMouseDownEvent(event));
return null;

代码示例来源:origin: org.vaadin.addons/dragdroplayouts

target.getElement().dispatchEvent(createMouseDownEvent(event));
return null;

相关文章

微信公众号

最新文章

更多

Element类方法