There are several ways to accomplish the same thing, depending on exactly what it is you want to customize.
The first, most exact translation of the code you've posted, would be to build a GWT Cell instance and attach it to your ColumnConfig. These uses SafeHtml to ensure that all content will be outputted correctly, and can accept events to make lightweight widget-like elements to draw cheaply.
This sample assumes that you need the entire model to read from multiple properties of your bean to render content, and so uses the IdentityValueProvider, which makes sure that the model itself is passed to be drawn.
Code:
ColumnConfig<MyData, MyData> column = new ColumnConfig<MyData, MyData>(new IdentityValueProvider<MyData>());
column.setCell(new AbstractCell<MyData>() {
@Override
public void render(Context context, MyData value, SafeHtmlBuilder sb) {
//append content to sb about the value object
}
});
Alternatively, you could build a specific ValueProvider to turn the model's data into something that is ready to be drawn as-is. ValueProvider<M, V> is an interface that is used by data widget code to read and write values of type V on a model of type M in a generic way. PropertyAccess is frequently used to automatically generate ValueProvider instances, but you can just as easily implement your own.
Code:
class CustomValueProvider implements ValueProvider<MyData, String> {
public String getValue(MyData data) {
return data.getA() + data.getB();
}
public void setValue(MyData object, String value) {
//do nothing, this is a read-only column, or build your own logic here
}
public String getPath() {
return "";// this may be needed if you allow remote sorting/filtering on this column
// if so, this string is what will be passed to the server to represent this column.
}
}