/** Test rendering the cell with a null value and no view data. */ public void testRenderNull() { Cell<T> cell = createCell(); SafeHtmlBuilder sb = new SafeHtmlBuilder(); Context context = new Context(0, 0, null); cell.render(context, null, sb); assertEquals(getExpectedInnerHtmlNull(), sb.toSafeHtml().asString()); }
/** Test rendering the cell with a negative index is handled. */ public void testRenderNegativeIndex() { Cell<T> cell = createCell(); T value = createCellValue(); SafeHtmlBuilder sb = new SafeHtmlBuilder(); Context context = new Context(-1, -1, null); cell.render(context, value, sb); assertEquals(getExpectedInnerHtml(), sb.toSafeHtml().asString()); }
@Override protected <X> void render( Context context, RoleProxy value, SafeHtmlBuilder sb, HasCell<RoleProxy, X> hasCell) { Cell<X> cell = hasCell.getCell(); sb.appendHtmlConstant("<td>"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("</td>"); }