I'm working with a JavaFX TreeTableView containing items of type BillingTableRow. I want the columns to be styled based on a value given by a method getType() in BillingTableRow, but I can't seem to access it from inside the callback that I'm trying to set up. Here is my code:
Callback<TreeTableColumn<BillingTableRow, Double>, TreeTableCell<BillingTableRow, Double>> eveningCallback = new Callback<TreeTableColumn<BillingTableRow, Double>, TreeTableCell<BillingTableRow, Double>>() {
@Override
public TreeTableCell<BillingTableRow, Double> call(TreeTableColumn<BillingTableRow, Double> p) {
return new EditableTreeTableDoubleCell() {
@Override
public void updateItem(Double item, boolean empty) {
super.updateItem(item, empty);
BillingTableRow row = (...)// Get attached BillingTableRow for current tree table row.
if (row.getType() == 0) {
setText(null);
}
}
};
}
};
eveningColumn.setCellFactory(eveningCallback);
What should I replace (...) with in order to get it to work?