我想根据CellTable(或DataGrid)中“row”值的值确定是否使用图标。我如何确定在构建Cell渲染器时?GWT确定单元格渲染过程中的行值
IconCellDecorator<String> icd = new IconCellDecorator<String>(res.search(), new ClickableTextCell()) {
@Override
protected boolean isIconUsed(String value) {
//value may not be unique across rows (column value), I really need the row instance here.
}
};
在我看来,我真的希望装饰者采取我的行类型,但然后ClickableTextCell将不知道如何获得它所需的字符串值。看来我必须编写一个自定义的IconCellDecorator,但认为可能有一个更干净的解决方案。 – Joel
刚刚意识到render()有一个给出索引和键的上下文......思考这可能会有所帮助。 – Joel