use of com.sun.javafx.scene.control.skin.VirtualFlow in project JavaFXLibrary by eficode.
the class ConvenienceKeywords method getTableColumnCells.
@RobotKeyword("Returns a list of *visible* cells(Nodes) of the given table column.\n\n" + "``locator`` is either a _query_ or _Object:Node_ for identifying the TableView element, see " + "`3. Locating or specifying UI elements`. \n\n" + "``column`` Integer value for the column")
@ArgumentNames({ "table", "column" })
public List<Object> getTableColumnCells(Object locator, int column) {
try {
TableView table = (TableView) objectToNode(locator);
List<Object> columnCells = new ArrayList<>();
VirtualFlow<?> vf = (VirtualFlow<?>) ((TableViewSkin<?>) table.getSkin()).getChildren().get(1);
for (int i = vf.getFirstVisibleCell().getIndex(); i < vf.getLastVisibleCell().getIndex() + 1; i++) {
robotLog("INFO", "index number: " + Integer.toString(i));
columnCells.add(mapObject(vf.getCell(i).getChildrenUnmodifiable().get(column)));
}
return mapObjects(columnCells);
} catch (ClassCastException cce) {
throw new JavaFXLibraryNonFatalException("Unable to handle argument as TableView!");
}
}
Aggregations