for (final Type type : category.getTypes()) {
TableColumn<Item, Integer> col = new TableColumn<Item, Integer>(type.getName());
col.setCellValueFactory(new Callback<CellDataFeatures<Item>,
ObservableValue<Integer>>() {
@Override
public void call(CellDataFeatures<Item> item) {
return item.getValue().getPrice(type);
}
});
priceColumn.add(col);
}
How do i get the value of type inside call method ??
Create a setType() and save the type as part of the first statement in the for loop. Create a static getType and access the type in the Callback class.