com.vaadin.ui.UI.getWindows()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(179)

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

UI.getWindows介绍

[英]Gets all the windows added to this UI.
[中]获取添加到此UI的所有窗口。

代码示例

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

/**
 * Validates the layout and returns a collection of errors.
 *
 * @since 7.1
 * @param ui
 *            The UI to validate
 * @return A collection of errors. An empty collection if there are no
 *         errors.
 */
public static List<InvalidLayout> validateLayouts(UI ui) {
  List<InvalidLayout> invalidRelativeSizes = ComponentSizeValidator
      .validateComponentRelativeSizes(ui.getContent(),
          new ArrayList<>(), null);
  // Also check any existing subwindows
  if (ui.getWindows() != null) {
    for (Window subWindow : ui.getWindows()) {
      invalidRelativeSizes = ComponentSizeValidator
          .validateComponentRelativeSizes(subWindow.getContent(),
              invalidRelativeSizes, null);
    }
  }
  return invalidRelativeSizes;
}

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

/**
 * If there are currently several windows visible, calling this method makes
 * this window topmost.
 * <p>
 * This method can only be called if this window connected a UI. Else an
 * illegal state exception is thrown. Also if there are modal windows and
 * this window is not modal, and illegal state exception is thrown.
 * <p>
 */
public void bringToFront() {
  UI uI = getUI();
  if (uI == null) {
    throw new IllegalStateException(
        "Window must be attached to parent before calling bringToFront method.");
  }
  int maxBringToFront = -1;
  for (Window w : uI.getWindows()) {
    if (!isModal() && w.isModal()) {
      throw new IllegalStateException(
          "The UI contains modal windows, non-modal window cannot be brought to front.");
    }
    if (w.bringToFront != null) {
      maxBringToFront = Math.max(maxBringToFront,
          w.bringToFront.intValue());
    }
  }
  bringToFront = Integer.valueOf(maxBringToFront + 1);
  markAsDirty();
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private boolean isWindowNotAlreadyAttached() {
  return !UI.getCurrent().getWindows().contains(this);
}

代码示例来源:origin: eclipse/hawkbit

private boolean isWindowNotAlreadyAttached() {
  return !UI.getCurrent().getWindows().contains(this);
}

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

protected boolean hasModalWindow() {
  UI ui = getComponent().getUI();
  return ui.getWindows().stream()
      .anyMatch(com.vaadin.ui.Window::isModal);
}

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

/**
 * Open the dialog Window using given <code>ui</code>. Any Window which <code>equals</code> to <code>window</code>
 * is removed from UI before adding the new Window.
 * @param ui UI to which to attach the dialog window
 */
protected void openDialogWindow(UI ui) {
  if (ui == null) {
    throw new IllegalStateException("No UI available to open Dialog Window");
  }
  List<Window> toRemove = new LinkedList<>();
  for (Window wnd : ui.getWindows()) {
    if (this.equals(wnd)) {
      toRemove.add(wnd);
    }
  }
  for (Window wnd : toRemove) {
    ui.removeWindow(wnd);
  }
  ui.addWindow(this);
}

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

/**
 * Open a Window using given <code>ui</code>. Any Window which <code>equals</code> to <code>window</code> is removed
 * from UI before adding the new Window.
 * @param window Window to open
 */
private static void openWindow(UI ui, Window window) {
  List<Window> toRemove = new LinkedList<>();
  for (Window wnd : ui.getWindows()) {
    if (window.equals(wnd)) {
      toRemove.add(wnd);
    }
  }
  for (Window wnd : toRemove) {
    ui.removeWindow(wnd);
  }
  ui.addWindow(window);
}

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

/**
 * Open the dialog Window using given <code>ui</code>. Any Window which <code>equals</code> to <code>window</code>
 * is removed from UI before adding the new Window.
 * @param ui UI to which to attach the dialog window
 */
protected void openDialogWindow(UI ui) {
  if (ui == null) {
    throw new IllegalStateException("No UI available to open Dialog Window");
  }
  List<Window> toRemove = new LinkedList<>();
  for (Window wnd : ui.getWindows()) {
    if (this.equals(wnd)) {
      toRemove.add(wnd);
    }
  }
  for (Window wnd : toRemove) {
    ui.removeWindow(wnd);
  }
  ui.addWindow(this);
}

代码示例来源:origin: jreznot/electron-java-app

private void onWindowExit() {
  if (!getUI().getWindows().isEmpty()) {

相关文章