Java Code Examples for javafx.scene.control.TableCell#getGraphic()

The following examples show how to use javafx.scene.control.TableCell#getGraphic() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavaFXTableViewCellElement.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override
public String _getValue() {
    TableCell<?, ?> cell = (TableCell<?, ?>) node;
    Node graphic = cell.getGraphic();
    JavaFXElement component = (JavaFXElement) JavaFXElementFactory.createElement(graphic, driver, window);
    if (graphic != null && component != null) {
        if (graphic instanceof CheckBox) {
            String cellText = cell.getText() == null ? "" : cell.getText();
            return cellText + ":" + component._getValue();
        }
        return component._getValue();
    }
    return super._getValue();
}
 
Example 2
Source File: JavaFXTableCellElement.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
private Node getEditor() {
    TableCell cell = (TableCell) getPseudoComponent();
    cell.getTableView().edit(viewRow, cell.getTableColumn());
    Node cellComponent = cell.getGraphic();
    cellComponent.getProperties().put("marathon.celleditor", true);
    cellComponent.getProperties().put("marathon.cell", cell);
    return cellComponent;
}