Class OdfTextListStyle

All Implemented Interfaces:
Serializable, Cloneable, Comparable, OdfStylePropertySet, Element, ElementTraversal, EventTarget, Node, NodeList, TypeInfo

public class OdfTextListStyle extends TextListStyleElement
Convenient functionalty for the parent ODF OpenDocument element

List styles require a lot of code to create one level at a time. This class contains constructors that create an entire OdfListStyle based on a delimited string or an array of strings. Each item in the string (or array) represents a list level style for levels 1-10.

If an item contains 1, I, i, A, or a , then it is presumed to be a numbering style; otherwise it is a bulleted style.

See Also:
  • Field Details

    • MAX_LIST_LEVEL

      protected static final int MAX_LIST_LEVEL
      Maximum number of levels in a list.
      See Also:
    • SHOW_ALL_LEVELS

      public static final boolean SHOW_ALL_LEVELS
      List should show all levels of numbering.
      See Also:
    • SHOW_ONE_LEVEL

      public static final boolean SHOW_ONE_LEVEL
      List should show only one level of numbering.
      See Also:
  • Constructor Details

    • OdfTextListStyle

      public OdfTextListStyle(OdfFileDom ownerDoc)
    • OdfTextListStyle

      public OdfTextListStyle(OdfFileDom ownerDoc, String name, String specifiers, String delim, String spacing, boolean showAllLevels)
      Creates an OdfListStyle.
      Parameters:
      ownerDoc - the document that this list style belongs to.
      name - the name of this list style.
      specifiers - the string of level specifiers.
      delim - the delimiter for splitting the string into levels.
      spacing - a css "length" telling how far to indent each level; also min. label width
      showAllLevels - true if you want to display all levels of numbering, false otherwise.
    • OdfTextListStyle

      public OdfTextListStyle(OdfFileDom ownerDoc, String name, String[] specArray, String spacing, boolean showAllLevels)
      Constructor for OdfEasyListStyle.
      Parameters:
      ownerDoc - the document that this list style belongs to.
      name - the name of this list style.
      specArray - an array of strings of level specifications.
      spacing - a css "length" telling how far to indent each level; also min. label width
      showAllLevels - true if you want to display all levels of numbering, false otherwise.
  • Method Details

    • getLevel

      public TextListLevelStyleElementBase getLevel(int level)
      returns the given level or null if it does not exist
      Parameters:
      level - is the level number that should be returned
      Returns:
      an instance of TextListLevelStyleImageElement, TextListLevelStyleBulletElement, TextListLevelStyleNumberElement or null.
    • getOrCreateListLevel

      public TextListLevelStyleElementBase getOrCreateListLevel(int level, Class clazz)
      always returns the given level with the given class. If that level does not exist or has a different class than it is (re)created.
      Parameters:
      level - is the level number that should be returned
      clazz - is the class of the level, should be TextListLevelStyleImageElement, TextListLevelStyleBulletElement or TextListLevelStyleNumberElement.
      Returns:
      a list level style with the given level and class
    • getFamily

      public OdfStyleFamily getFamily()
      Overrides:
      getFamily in class OdfStyleBase
      Returns:
      the style family of the style or null if none existent
    • getParentStyle

      public OdfStyleBase getParentStyle()
      Overrides:
      getParentStyle in class OdfStyleBase
      Returns:
      the style parent of the style or null if none existent
    • toString

      public String toString()
      Overrides:
      toString in class OdfElement