Class OrderedUnorderedList

    • Constructor Detail

      • OrderedUnorderedList

        public OrderedUnorderedList()
    • Method Detail

      • populateList

        private java.util.List<Element> populateList​(java.util.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.