我正在尝试根据存储在模型对象中的 RGB 值更改 NatTable 中行的颜色。我找到了有关如何在我的 NatTable 中设置自定义样式的信息,但这些似乎都使用预定义的标签,而不是基于动态值的标签。
//add custom cell label to cells that contain value AAA in column 2
CellOverrideLabelAccumulator cellLabelAccumulator
= new CellOverrideLabelAccumulator(gridLayer.getBodyDataProvider());
cellLabelAccumulator.registerOverride("AAA", 2, CELL_LABEL);
// Register label accumulator with the data layer
bodyDataLayer.setConfigLabelAccumulator(cellLabelAccumulator);
CELL_LABEL 是一个链接到预建标签的字符串。