org.eclipse.jface.window.Window.getModalChild()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(122)

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

Window.getModalChild介绍

[英]Returns the most specific modal child from the given list of Shells.
[中]返回给定Shell列表中最具体的模态子级。

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * Returns the most specific modal child from the given list of Shells.
 *
 * @param toSearch shells to search for modal children
 * @return the most specific modal child, or null if none
 *
 * @since 3.1
 */
private static Shell getModalChild(Shell[] toSearch) {
  int modal = SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL;
  for (int i = toSearch.length - 1; i >= 0; i--) {
    Shell shell = toSearch[i];
    // Check if this shell has a modal child
    Shell[] children = shell.getShells();
    Shell modalChild = getModalChild(children);
    if (modalChild != null) {
      return modalChild;
    }
    // If not, check if this shell is modal itself
    if (shell.isVisible() && (shell.getStyle() & modal) != 0) {
      return shell;
    }
  }
  return null;
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Returns the most specific modal child from the given list of Shells. 
 * 
 * @param toSearch shells to search for modal children
 * @return the most specific modal child, or null if none
 * 
 * @since 1.0
 */
private static Shell getModalChild(Shell[] toSearch) {
  int modal = SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL;
  for (int i = toSearch.length - 1; i >= 0; i--) {
    Shell shell = toSearch[i];
    
    // Check if this shell has a modal child
    Shell[] children = shell.getShells();
    Shell modalChild = getModalChild(children);
    if (modalChild != null) {
      return modalChild;
    }
    
    // If not, check if this shell is modal itself
    if (shell.isVisible() && (shell.getStyle() & modal) != 0) {
      return shell;
    }
  }
  
  return null;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Returns the most specific modal child from the given list of Shells.
 *
 * @param toSearch shells to search for modal children
 * @return the most specific modal child, or null if none
 *
 * @since 3.1
 */
private static Shell getModalChild(Shell[] toSearch) {
  int modal = SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL;
  for (int i = toSearch.length - 1; i >= 0; i--) {
    Shell shell = toSearch[i];
    // Check if this shell has a modal child
    Shell[] children = shell.getShells();
    Shell modalChild = getModalChild(children);
    if (modalChild != null) {
      return modalChild;
    }
    // If not, check if this shell is modal itself
    if (shell.isVisible() && (shell.getStyle() & modal) != 0) {
      return shell;
    }
  }
  return null;
}

相关文章