HtmlCellCssApplier implements CssApplier<HtmlCell> { public HtmlCell apply(final HtmlCell cell, final Tag t, final MarginMemory memory, final PageSizeContainable psc) { return apply(cell, t, memory, psc, null); }  HtmlCell apply(final HtmlCell cell, final Tag t, final MarginMemory memory, final PageSizeContainable psc); HtmlCell apply(final HtmlCell cell, final Tag t, final MarginMemory memory, final PageSizeContainable psc, final HtmlPipelineContext ctx);  }
@Test public void resolveColspan() { assertEquals(1, cell.getColspan(), 0); tag.getAttributes().put("colspan", "2"); applier.apply(cell, tag, config,config); assertEquals(2, cell.getColspan()); }
@Test public void resolveRowspan() { assertEquals(1, cell.getRowspan(), 0); tag.getAttributes().put("rowspan", "3"); applier.apply(cell, tag, config,config); assertEquals(3, cell.getRowspan()); }
@Test public void resolveFixedWidth() { HtmlCell fixed = new HtmlCell(); tag.getAttributes().put("width", "90pt"); fixed = applier.apply(fixed, tag, config,config); assertEquals(90, (fixed).getFixedWidth(), 0); }
@Test public void resolveBorderWidth() { assertEquals(0.5, cell.getBorderWidthTop(), 0); tag.getCSS().put("border-width-top", "5pt"); tag.getCSS().put("border-width-left", "6pt"); tag.getCSS().put("border-width-right", "7pt"); tag.getCSS().put("border-width-bottom", "8pt"); applier.apply(cell, tag, config,config); assertEquals(5, cell.getCellValues().getBorderWidthTop(), 0); assertEquals(6, cell.getCellValues().getBorderWidthLeft(), 0); assertEquals(7, cell.getCellValues().getBorderWidthRight(), 0); assertEquals(8, cell.getCellValues().getBorderWidthBottom(), 0); }
@Test public void resolveBorderColor() { assertEquals(null, cell.getBorderColorTop()); tag.getCSS().put("border-color-top", "red"); tag.getCSS().put("border-color-left", "#0f0"); tag.getCSS().put("border-color-right", "#0000ff"); tag.getCSS().put("border-color-bottom", "rgb(000,111,222)"); applier.apply(cell, tag, config,config); assertEquals(BaseColor.RED, cell.getCellValues().getBorderColorTop()); assertEquals(BaseColor.GREEN, cell.getCellValues().getBorderColorLeft()); assertEquals(BaseColor.BLUE, cell.getCellValues().getBorderColorRight()); assertEquals(new BaseColor(000,111,222), cell.getCellValues().getBorderColorBottom()); }