我想根據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