com.vaadin.flow.dom.Element.appendVirtualChild()方法的使用及代码示例

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

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

Element.appendVirtualChild介绍

暂无

代码示例

代码示例来源:origin: com.vaadin/flow-server

/**
 * Adds a new {@link BrowserWindowResizeListener} to this UI. The listener
 * will be notified whenever the browser window within which this UI resides
 * is resized.
 *
 * @param resizeListener
 *            the listener to add, not {@code null}
 * @return a registration object for removing the listener
 *
 * @see BrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent)
 * @see Registration
 */
public Registration addBrowserWindowResizeListener(
    BrowserWindowResizeListener resizeListener) {
  Objects.requireNonNull(resizeListener);
  if (resizeReceiver == null) {
    // lazy creation which is done only one time since there is no way
    // to remove virtual children
    resizeReceiver = new ResizeEventReceiver();
    ui.getElement().appendVirtualChild(resizeReceiver.getElement());
  }
  if (resizeReceiver.windowResizeListenersSize == 0) {
    // JS resize listener may be completely disabled if there are not
    // listeners
    executeJavaScript(LazyJsLoader.WINDOW_LISTENER_JS, resizeReceiver);
  }
  return resizeReceiver.addListener(resizeListener);
}

代码示例来源:origin: com.vaadin/vaadin-notification-flow

private void initBaseElementsAndListeners() {
  getElement().appendChild(templateElement);
  getElement().appendVirtualChild(container);
  getElement().addEventListener("opened-changed", event -> {
    if (autoAddedToTheUi && !isOpened()) {
      getElement().removeFromParent();
      autoAddedToTheUi = false;
    }
  });
}

代码示例来源:origin: com.holon-platform.vaadin/holon-vaadin-flow

ui.getElement().appendVirtualChild(windowSizeReceiver.getElement());
try {
  ui.getPage().executeJavaScript(

代码示例来源:origin: com.vaadin/flow-data

owner.appendVirtualChild(container);
rendering.setContainer(container);
String templateInnerHtml;

代码示例来源:origin: com.vaadin/vaadin-context-menu-flow

/**
 * Creates an empty context menu.
 */
public ContextMenuBase() {
  container = new Element("div");
  getElement().appendVirtualChild(container);
  // Workaround for: https://github.com/vaadin/flow/issues/3496
  getElement().setProperty("opened", false);
  // Don't open the overlay immediately with any event, let
  // contextMenuConnector.js make a server round-trip first.
  setOpenOn("none");
  getElement().addEventListener("opened-changed", event -> {
    if (autoAddedToTheUi && !isOpened()) {
      getElement().removeFromParent();
      autoAddedToTheUi = false;
    }
  });
  addAttachListener(event -> resetContent());
}

相关文章