com.itextpdf.tool.xml.html.table
Class Table

java.lang.Object
  extended by com.itextpdf.tool.xml.html.AbstractTagProcessor
      extended by com.itextpdf.tool.xml.html.table.Table
All Implemented Interfaces:
CssAppliersAware, TagProcessor

public class Table
extends AbstractTagProcessor

Author:
Emiel Ackermann

Field Summary
static float DEFAULT_CELL_BORDER_WIDTH
           
 
Constructor Summary
Table()
          Default constructor.
 
Method Summary
 List<Element> end(WorkerContext ctx, Tag tag, List<Element> currentContent)
          Classes extending AbstractTagProcessor should override this method for actions that should be done in TagProcessor.endElement(WorkerContext, Tag, List).
static float getBorderOrCellSpacing(boolean getHor, Map<String,String> css, Map<String,String> attributes)
          Extracts and parses the style border-spacing or the attribute cellspacing of a table tag, if present.
 boolean isStackOwner()
          Defaults to false.
static TableStyleValues setStyleValues(Tag tag)
          Set the table style values in a TableStyleValues object based on attributes and css of the given tag.
 
Methods inherited from class com.itextpdf.tool.xml.html.AbstractTagProcessor
content, currentContentToParagraph, currentContentToParagraph, endElement, getCssAppliers, getCSSResolver, getHtmlPipelineContext, setCssAppliers, start, startElement, textContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CELL_BORDER_WIDTH

public static final float DEFAULT_CELL_BORDER_WIDTH
See Also:
Constant Field Values
Constructor Detail

Table

public Table()
Default constructor.

Method Detail

end

public List<Element> end(WorkerContext ctx,
                         Tag tag,
                         List<Element> currentContent)
Description copied from class: AbstractTagProcessor
Classes extending AbstractTagProcessor should override this method for actions that should be done in TagProcessor.endElement(WorkerContext, Tag, List). The AbstractTagProcessor.endElement(WorkerContext, Tag, List) calls this method after or before doing certain stuff, (see it's description).

Overrides:
end in class AbstractTagProcessor
Parameters:
ctx - the WorkerContext
tag - the tag
currentContent - the content created from e.g. inner tags, inner content and not yet added to document.
Returns:
a List containing iText Element objects

setStyleValues

public static TableStyleValues setStyleValues(Tag tag)
Set the table style values in a TableStyleValues object based on attributes and css of the given tag.

Parameters:
tag - containing attributes and css.
Returns:
a TableStyleValues object containing the table's style values.

getBorderOrCellSpacing

public static float getBorderOrCellSpacing(boolean getHor,
                                           Map<String,String> css,
                                           Map<String,String> attributes)
Extracts and parses the style border-spacing or the attribute cellspacing of a table tag, if present. Favors the style border-spacing over the attribute cellspacing.
If style="border-collapse:collapse" is found in the css, the spacing is always 0f.
If no spacing is set, the default of 1.5pt is returned.

Parameters:
getHor - true for horizontal spacing, false for vertical spacing.
css - of the table tag.
attributes - of the table tag.
Returns:
horizontal or vertical spacing between two cells or a cell and the border of the table.

isStackOwner

public boolean isStackOwner()
Description copied from class: AbstractTagProcessor
Defaults to false.

Specified by:
isStackOwner in interface TagProcessor
Overrides:
isStackOwner in class AbstractTagProcessor
Returns:
true if the tag implementation must keep it's own currentContent stack.
See Also:
TagProcessor.isStackOwner()


Copyright © 2012. All Rights Reserved.