Class List

All Implemented Interfaces:
IAbstractElement, IBlockElement, IElement, IPropertyContainer, IAccessibleElement

public class List extends BlockElement<List>
A List is a layout element representing a series of objects that are vertically outlined with the same or very similar layout properties, giving it a sense of unity. It contains ListItem objects that can optionally be prefixed with a symbol and/or numbered.
  • Field Details

  • Constructor Details

    • List

      public List()
      Creates a List with the DEFAULT_LIST_SYMBOL as a prefix.
    • List

      public List (ListNumberingType listNumberingType)
      Creates a List with a custom numbering type.
      Parameters:
      listNumberingType - a prefix style
  • Method Details

    • getDefaultProperty

      public  T1 getDefaultProperty (int property)
      Description copied from interface: IPropertyContainer
      Gets the default property from this entity.
      Specified by:
      getDefaultProperty in interface IPropertyContainer
      Overrides:
      getDefaultProperty in class BlockElement<List>
      Type Parameters:
      T1 - the return type associated with the property
      Parameters:
      property - the property to be retrieved
      Returns:
      the default property value. If the default property is not defined, null will be returned
    • add

      public List add (ListItem listItem)
      Adds a new ListItem to the bottom of the List.
      Parameters:
      listItem - a new list item
      Returns:
      this list.
    • add

      public List add (String text)
      Adds a new ListItem to the bottom of the List.
      Parameters:
      text - textual contents of the new list item
      Returns:
      this list.
    • setItemStartIndex

      public List setItemStartIndex (int start)
      Customizes the index of the first item in the list.
      Parameters:
      start - the custom index, as an int
      Returns:
      this list.
    • setListSymbol

      public List setListSymbol (String symbol)
      Sets the list symbol to be used. This will create an unordered list, i.e. all list items will be shown with the same prefix.
      Parameters:
      symbol - the textual symbol to be used for all items.
      Returns:
      this list.
    • setListSymbol

      public List setListSymbol (Text text)
      Sets the list symbol to be used. This will create an unordered list, i.e. all list items will be shown with the same prefix.
      Parameters:
      text - the Text object to be used for all items.
      Returns:
      this list.
    • setListSymbol

      public List setListSymbol (Image image)
      Sets the list symbol to be used. This will create an unordered list, i.e. all list items will be shown with the same prefix.
      Parameters:
      image - the Image object to be used for all items.
      Returns:
      this list.
    • setListSymbol

      public List setListSymbol (ListNumberingType listNumberingType)
      Sets the list numbering type to be used. This will create an ordered list, i.e. every ListItem will have a unique prefix.
      Parameters:
      listNumberingType - the ListNumberingType that will generate appropriate prefixes for the ListItems.
      Returns:
      this list.
    • setListSymbolAlignment

      public List setListSymbolAlignment (ListSymbolAlignment alignment)
      A specialized enum containing alignment properties for list symbols. ListSymbolAlignment.LEFT means that the items will be aligned as follows: 9. Item 9 10. Item 10

      Whereas ListSymbolAlignment.RIGHT means the items will be aligned as follows: 9. Item 9 10. Item 10

      Parameters:
      alignment - the alignment of the list symbols
      Returns:
      this element
    • getSymbolIndent

      public Float getSymbolIndent()
      Gets the indent offset of the ListItem symbols.
      Returns:
      the indent offset as a float.
    • setSymbolIndent

      public List setSymbolIndent (float symbolIndent)
      Sets the indent offset of the ListItem symbols.
      Parameters:
      symbolIndent - the new indent offset.
      Returns:
      this list.
    • getPostSymbolText

      public String getPostSymbolText()
      Gets the piece of text that is added after the ListItem symbol.
      Returns:
      the post symbol text
    • setPostSymbolText

      public void setPostSymbolText (String postSymbolText)
      Sets a piece of text that should be added after the ListItem symbol.
      Parameters:
      postSymbolText - the post symbol text
    • getPreSymbolText

      public String getPreSymbolText()
      Gets the piece of text that is added before the ListItem symbol.
      Returns:
      the pre symbol text
    • setPreSymbolText

      public void setPreSymbolText (String preSymbolText)
      Sets a piece of text that should be added before the ListItem symbol.
      Parameters:
      preSymbolText - the pre symbol text
    • getAccessibilityProperties

      public AccessibilityProperties getAccessibilityProperties()
      Description copied from interface: IAccessibleElement
      Returns:
      an interface that allows to specify properties of a tagged element in Tagged PDF.
    • makeNewRenderer

      protected IRenderer makeNewRenderer()
      Description copied from class: AbstractElement
      Creates new renderer instance.
      Specified by:
      makeNewRenderer in class AbstractElement<List>
      Returns:
      new IRenderer