currentfont.pop();
return;
}
case Element.CELL:
{
Cell cell = (Cell) element;
// start tag
addTabs(indent);
if (cell.isHeader()) {
writeStart(HtmlTags.HEADERCELL);
}
else {
writeStart(HtmlTags.CELL);
}
writeMarkupAttributes(markup);
if (cell.getBorderWidth() != Rectangle.UNDEFINED) {
write(HtmlTags.BORDERWIDTH, String.valueOf(cell.getBorderWidth()));
}
if (cell.getBorderColor() != null) {
write(HtmlTags.BORDERCOLOR, HtmlEncoder.encode(cell.getBorderColor()));
}
if (cell.getBackgroundColor() != null) {
write(HtmlTags.BACKGROUNDCOLOR, HtmlEncoder.encode(cell.getBackgroundColor()));
}
String alignment = HtmlEncoder.getAlignment(cell.getHorizontalAlignment());
if (!"".equals(alignment)) {
write(HtmlTags.HORIZONTALALIGN, alignment);
}
alignment = HtmlEncoder.getAlignment(cell.getVerticalAlignment());
if (!"".equals(alignment)) {
write(HtmlTags.VERTICALALIGN, alignment);
}
if (cell.getWidthAsString() != null) {
write(HtmlTags.WIDTH, cell.getWidthAsString());
}
if (cell.getColspan() != 1) {
write(HtmlTags.COLSPAN, String.valueOf(cell.getColspan()));
}
if (cell.getRowspan() != 1) {
write(HtmlTags.ROWSPAN, String.valueOf(cell.getRowspan()));
}
if (cell.getMaxLines() == 1) {
write(HtmlTags.STYLE, "white-space: nowrap;");
}
os.write(GT);
// contents
if (cell.isEmpty()) {
write(NBSP);
} else {
for (Iterator i = cell.getElements(); i.hasNext(); ) {
write((Element) i.next(), indent + 1);
}
}
// end tag
addTabs(indent);
if (cell.isHeader()) {
writeEnd(HtmlTags.HEADERCELL);
}
else {
writeEnd(HtmlTags.CELL);
}