Class MultilevelNumberingSupport

java.lang.Object
com.scroogexhtml.xmldom.numbering.MultilevelNumberingSupport
All Implemented Interfaces:
NumberingWriter

public class MultilevelNumberingSupport extends Object implements NumberingWriter
This class provides list support.
  • Constructor Details

    • MultilevelNumberingSupport

      public MultilevelNumberingSupport(Document doc)
    • MultilevelNumberingSupport

      public MultilevelNumberingSupport(Document doc, OutputBudget budget)
      Parameters:
      doc - the document
      budget - the output budget of the conversion, or null for no limits
  • Method Details

    • setListLevel

      public void setListLevel(int value)
      Sets the list level of the current paragraph (\ilvlN). The nesting changes when its list item is created, so it does not matter whether \ilvlN comes before or after \lsN.
      Specified by:
      setListLevel in interface NumberingWriter
    • getListLevel

      public int getListLevel()
      Specified by:
      getListLevel in interface NumberingWriter
    • setListIndex

      public void setListIndex(int value)
      Description copied from interface: NumberingWriter
      Sets the list (\lsN) of the next list item; items of different lists at the same level go in separate lists.
      Specified by:
      setListIndex in interface NumberingWriter
      Parameters:
      value - the list override index, or NumberingWriter.NO_LIST_INDEX
    • setNumberType

      public void setNumberType(NumberType value)
      Specified by:
      setNumberType in interface NumberingWriter
    • setNumberingStyle

      public void setNumberingStyle(boolean value)
      Specified by:
      setNumberingStyle in interface NumberingWriter
    • isNumberingStyle

      public boolean isNumberingStyle()
      Specified by:
      isNumberingStyle in interface NumberingWriter
    • createListItem

      public Element createListItem(Element externalParent)
      Creates a list item, as the Object Pascal product does (TSxOutputWriter.PrepareListLevel):
      • closes every list whose lowest level is above the item's level, and the list that would take the item if it belongs to a different list (\lsN) or has a different number type, so two lists at the same level are not merged; the root list is closed too, and a new one follows it in externalParent
      • opens one nested list, under the last item, also for an increase by several levels (valid HTML, the depth is compressed). The list takes the levels from the previous level + 1, so a later decrease to any level in between still ends up in it (0, 3, 1: the level-1 item goes under the level-0 item, not back into the root list).
      A list goes on only if it is still the last element in externalParent, so the items of each table cell form their own list (\cell ends a list paragraph like \par). The root list takes any level, so a list that starts at level 2 starts at the top. An increase by several levels must not be undone by climbing one list per level: that climbed out of the root list into the surrounding element and the document node (DOMException HIERARCHY_REQUEST_ERR, found by fuzzing).
      Specified by:
      createListItem in interface NumberingWriter