javafx.scene.control.TableView.getChildrenUnmodifiable()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(189)

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

TableView.getChildrenUnmodifiable介绍

暂无

代码示例

代码示例来源:origin: org.loadui/testFx

/**
 * @param tableSelector Selektor zur Identifikation der Tabelle.
 * @param row Zeilennummer
 * @return Die entsprechende Zeile.
 */
protected static TableRow<?> row(String tableSelector, int row) {
  TableView<?> tableView = getTableView(tableSelector);
  List<Node> current = tableView.getChildrenUnmodifiable();
  while (current.size() == 1) {
    current = ((Parent) current.get(0)).getChildrenUnmodifiable();
  }
  current = ((Parent) current.get(1)).getChildrenUnmodifiable();
  while (!(current.get(0) instanceof TableRow)) {
    current = ((Parent) current.get(0)).getChildrenUnmodifiable();
  }
  Node node = current.get(row);
  if (node instanceof TableRow) {
    return (TableRow<?>) node;
  } else {
    throw new RuntimeException("Expected Group with only TableRows as children");
  }
}

代码示例来源:origin: org.testfx/testfx-legacy

/**
 * @param tableSelector Selektor zur Identifikation der Tabelle. //TODO translate to english
 * @param row           Zeilennummer
 * @return Die entsprechende Zeile.
 */
protected static TableRow<?> row(String tableSelector, int row) {
  TableView<?> tableView = getTableView(tableSelector);
  List<Node> current = tableView.getChildrenUnmodifiable();
  while (current.size() == 1) {
    current = ((Parent) current.get(0)).getChildrenUnmodifiable();
  }
  current = ((Parent) current.get(1)).getChildrenUnmodifiable();
  while (!(current.get(0) instanceof TableRow)) {
    current = ((Parent) current.get(0)).getChildrenUnmodifiable();
  }
  Node node = current.get(row);
  if (node instanceof TableRow) {
    return (TableRow<?>) node;
  }
  else {
    throw new RuntimeException("Expected Group with only TableRows as children");
  }
}

相关文章