List of usage examples for javafx.scene.control TreeTableCell getTableColumn
public final TreeTableColumn<S, T> getTableColumn()
From source file:org.eclipse.jubula.rc.javafx.tester.adapter.TreeTableOperationContext.java
/** * Gets the rendered text of a TreeTableCell * /*from w w w. j ava2s . c o m*/ * @param node * this can be a cell or a tree item * @param col * if node is a tree item this parameter is used to find the cell * to get the rendered text from * @return the rendered text */ private String getRenderedTextFromCell(final Object node, final int col) { if (node instanceof TreeItem<?>) { scrollNodeToVisible(node); } String result = EventThreadQueuerJavaFXImpl.invokeAndWait("getRenderedText", new Callable<String>() { //$NON-NLS-1$ @Override public String call() throws Exception { if (node instanceof TreeTableCell) { TreeTableCell<?, ?> cell = (TreeTableCell<?, ?>) node; return cell.getText(); } else if (node instanceof TreeItem) { TreeItem<?> item = (TreeItem<?>) node; TreeTableView<?> treeTable = getTree(); List<TreeTableCell> cells = new NodeTraverseHelper<TreeTableCell>().getInstancesOf(treeTable, TreeTableCell.class); for (TreeTableCell<?, ?> cell : cells) { // Nullchecks because of the virtual flow cells // are created which might not be associated // with a row or an item TreeTableRow<?> ttRow = cell.getTreeTableRow(); if (ttRow == null) { continue; } TreeItem<?> checkItem = ttRow.getTreeItem(); if (checkItem == null) { continue; } if (item != null && checkItem.equals(item) && treeTable.getColumns().indexOf(cell.getTableColumn()) == col) { return cell.getText(); } } } return null; } }); return result; }
From source file:org.eclipse.jubula.rc.javafx.tester.adapter.TreeTableOperationContext.java
@Override public Rectangle getNodeBounds(final Object node) { scrollNodeToVisible(node);/*from w ww.j ava 2 s . c om*/ return EventThreadQueuerJavaFXImpl.invokeAndWait("getNodeBounds", new Callable<Rectangle>() { //$NON-NLS-1$ @Override public Rectangle call() throws Exception { TreeTableView<?> treeTable = getTree(); treeTable.layout(); TreeItem<?> item = (TreeItem<?>) node; List<TreeTableCell> cells = new NodeTraverseHelper<TreeTableCell>().getInstancesOf(treeTable, TreeTableCell.class); for (TreeTableCell<?, ?> cell : cells) { // Nullchecks because of the virtual flow cells // are created which might not be associated // with a row or an item TreeTableRow<?> ttRow = cell.getTreeTableRow(); if (ttRow == null) { continue; } TreeItem<?> checkItem = ttRow.getTreeItem(); if (checkItem == null) { continue; } if (item != null && checkItem.equals(item) && treeTable.getColumns().indexOf(cell.getTableColumn()) == m_column) { Rectangle b = NodeBounds.getAbsoluteBounds(cell); Rectangle treeB = NodeBounds.getAbsoluteBounds(treeTable); return new Rectangle(Math.abs(treeB.x - b.x), Math.abs(treeB.y - b.y), Rounding.round(b.getWidth()), Rounding.round(b.getHeight())); } } return null; } }); }