com.vaadin.flow.component.UI.getElement()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(177)

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

UI.getElement介绍

[英]Gets the element for this UI.

The UI element corresponds to the tag on the page
[中]获取此UI的元素。
UI元素对应于页面上的标记

代码示例

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

/**
 * Collect all Components implementing {@link BeforeLeaveObserver} connected
 * to the given UI.
 *
 * @param ui
 *            UI to search from
 * @return navigation listeners
 */
public static List<BeforeLeaveObserver> collectBeforeLeaveObservers(UI ui) {
  return getImplementingComponents(flattenDescendants(ui.getElement()),
      BeforeLeaveObserver.class).collect(Collectors.toList());
}

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

/**
 * Collect all Components implementing {@link AfterNavigationObserver} that
 * are found in the given UI.
 *
 * @param ui
 *            UI to search from
 * @return after navigation listeners
 */
public static List<AfterNavigationObserver> collectAfterNavigationObservers(
    UI ui) {
  return getImplementingComponents(flattenDescendants(ui.getElement()),
      AfterNavigationObserver.class).collect(Collectors.toList());
}

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

/**
 * Inform components connected to the given ui that implement
 * {@link LocaleChangeObserver} about locale change.
 *
 * @param ui
 *            UI for locale change
 */
public static void informLocaleChangeObservers(UI ui) {
  LocaleChangeEvent localeChangeEvent = new LocaleChangeEvent(ui,
      ui.getLocale());
  collectLocaleChangeObservers(ui.getElement())
      .forEach(observer -> observer.localeChange(localeChangeEvent));
}

代码示例来源: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/flow-server

Element uiElement = ui.getElement();

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

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

相关文章