Vaadin 8.1 Grid setCellStyleGenerator replacement

I try to color individual cells in a grid according to their content. I can set styles for rows with grid.setStyleGenerator and styles for columns with grid.getColumn().setStyleGenerator but I can’t get/set a style for an induvidual cell.
How can this be accomplished with Vaadin 8.1?


Column.setStyleGenerator is the method you should use. Determine cell you want to style based on the column value. For example, if the column data type is String, you could use something like

column.setStyleGenerator(text -> "ok".equals(text) ? "green" : ""); // green color for "ok" cells -Olli