Class Table

All Implemented Interfaces:
CssAppliersAware, TagProcessor

public class Table extends AbstractTagProcessor
Author:
Emiel Ackermann
  • Field Details

    • DEFAULT_CELL_BORDER_WIDTH

      public static final float DEFAULT_CELL_BORDER_WIDTH
      See Also:
  • Constructor Details

    • Table

      public Table()
      Default constructor.
  • Method Details

    • 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
    • intPdfPTable

      protected PdfPTable intPdfPTable(int numberOfColumn)
    • 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.
    • setBorderAttributeForCell

      public static TableStyleValues setBorderAttributeForCell(Tag tag)
    • 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: