TreeTableView<Person> treeTable = new TreeTableView<Person>(rootTreeTableItem);
TreeTableColumn<Person, String> firstNameTreeCol = new TreeTableColumn<Person, String>("First Name");
firstNameTreeCol.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<Person, String>, ObservableValue<String>>() {
@Override public ObservableValue<String> call(CellDataFeatures<Person, String> param) {
return new ReadOnlyStringWrapper(param.getValue().getValue().getFirstName());
}
});
TreeTableColumn<Person, String> lastNameTreeCol = new TreeTableColumn<Person, String>("Last Name");
lastNameTreeCol.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<Person, String>, ObservableValue<String>>() {
@Override public ObservableValue<String> call(CellDataFeatures<Person, String> param) {
return new ReadOnlyStringWrapper(param.getValue().getValue().getLastName());
}
});
TreeTableColumn<Person, String> primaryMailCol = new TreeTableColumn<Person, String>("primary Mail");
primaryMailCol.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<Person, String>, ObservableValue<String>>() {
@Override public ObservableValue<String> call(CellDataFeatures<Person, String> param) {
return new ReadOnlyStringWrapper(param.getValue().getValue().getPrimaryEmail());
}
});
TreeTableColumn<Person, Boolean> vipTreeTableCol = new TreeTableColumn<Person, Boolean>("VIP");
vipTreeTableCol.setCellFactory(CheckBoxTreeTableCell.forTreeTableColumn(vipTreeTableCol));
vipTreeTableCol.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<Person, Boolean>, ObservableValue<Boolean>>() {