When the code segment "new TextColumn(){...}, "MyObjectId");" executes then what does the code inside the outermost of pair curly braces represent? Does it represent an anonymous inner class instance of the TextColumn object? Does it represent the definition of the TextColumn object?
table.addColumn(new TextColumn<MyObjectProxy>() {
Renderer<Integer> renderer = new AbstractRenderer<Integer>() {
public String render(Integer obj) {
return obj == null ? "" : String.valueOf(obj);
}
};
@Override
public String getValue(MyObjectProxy object) {
return renderer.render(object.getMyObjectId());
}
}, "MyObjectId");
if you are wondering the TextColumn is from the com.google.gwt.user.cellview.client.TextColumn package.
That's an anonymous inner class that extends TextColumn<MyObjectProxy>
. In it, it has a field named renderer
of type Renderer<Integer>
that is initialized with an instance of an anonymous inner class that extends AbstractRenderer<Integer>
. There is also an override of method getValue
below that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With