views:

391

answers:

1

I've used the ScrollTable widget for GWT and I have a need for a custom cell renderer so I can isolate this code from the rest of the app.

I would like to use generics if possible to get it type safe. This cell renderer will take a long as a value and do some calculation before displaying the result. Anyone having a good example on how to implement such a custom renderer?

A: 

I'm not sure about ScrollTable, but if you use PagingScrollTable from the GWT Incubator, you implement AbstractColumnDefinition<RowType,ColType> for your columnDefinition. You may then override CellRenderer<RowType,ColType> and apply it:

columnDefinition.setCellRenderer(cellRenderer);
Glenn