Class OrderedUnorderedList

java.lang.Object
com.itextpdf.tool.xml.html.AbstractTagProcessor
com.itextpdf.tool.xml.html.OrderedUnorderedList
All Implemented Interfaces:
CssAppliersAware, TagProcessor

public class OrderedUnorderedList extends AbstractTagProcessor
  • Field Details

  • Constructor Details

    • OrderedUnorderedList

      public OrderedUnorderedList()
  • 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
    • populateList

      private List<Element> populateList(List<Element> currentContent)
      Fills a java.util.List with all elements found in currentContent. Places elements that are not a ListItem or List in a new ListItem object.
      Parameters:
      currentContent -
      Returns:
      java.util.List with only ListItems or Lists in it.
    • calculateTopOrBottomSpacing

      private float calculateTopOrBottomSpacing(boolean isTop, boolean storeMarginBottom, Tag tag, Tag child, WorkerContext ctx)
      Calculates top or bottom spacing of the list. In HTML following possibilities exist:
      • padding-top of the ul/ol tag == 0.
        The margin-top values of the ul/ol tag and its first li tag are compared. The total spacing before is the largest margin value and the first li's padding-top.
      • padding-top of the ul/ol tag != 0.
        The margin-top or bottom values of the ul/ol tag and its first li tag are accumulated, along with padding-top values of both tags.
      • padding-bottom of the ul/ol tag == 0.
        The margin-bottom values of the ul/ol tag and its last li tag are compared. The total spacing after is the largest margin value and the first li's padding-bottom.
      • padding-bottom of the ul/ol tag != 0.
        The margin-bottom or bottom values of the ul/ol tag and its last li tag are accumulated, along with padding-bottom values of both tags.
      Parameters:
      isTop - boolean, if true the top spacing is calculated, if false the bottom spacing is calculated.
      storeMarginBottom - if true the calculated margin bottom value is stored for later comparison with the top margin value of the next tag.
      tag - the ul/ol tag.
      child - first or last li tag of this list.
      ctx -
      Returns:
      float containing the spacing before or after.
    • 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: