1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
public class OverviewCell extends AbstractCell<OverviewDisplay>{
/**
* The html of the image used for contacts.
*/
private final String imageHtml;
public OverviewCell(Image image) {
//this.imageHtml = AbstractImagePrototype.create(image).getHTML();
this.imageHtml = image.getUrl();
}
@Override
public void render(Context context, OverviewDisplay value, SafeHtmlBuilder sb) {
// Value can be null, so do a null check..
if (value == null) {
return;
}
sb.appendHtmlConstant("<table>");
// Add the contact image.
sb.appendHtmlConstant("<tr><td>");
sb.appendHtmlConstant(imageHtml);
sb.appendHtmlConstant("</td>");
// Add the name and address.
sb.appendHtmlConstant("<td style='font-size:95%;'>");
sb.appendEscaped(value.getMainInformation().getText());
sb.appendHtmlConstant("</td></tr><tr><td>");
sb.appendEscaped(value.getInformation().getText());
sb.appendHtmlConstant("</td></tr></table>");
}
} |
Partager