Class ListItem

All Implemented Interfaces:
Element, MarkupAttributes, TextElementArray, Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public class ListItem extends Paragraph implements TextElementArray, MarkupAttributes
A ListItem is a Paragraph that can be added to a List.

Example 1:

 List list = new List(true, 20);
 list.add(new ListItem("First line"));
 list.add(new ListItem("The second line is longer to see what happens once the end of the line is reached. Will it start on a new line?"));
 list.add(new ListItem("Third line"));
 
The result of this code looks like this:
  1. First line
  2. The second line is longer to see what happens once the end of the line is reached. Will it start on a new line?
  3. Third line
Example 2:
 List overview = new List(false, 10);
 overview.add(new ListItem("This is an item"));
 overview.add("This is another item");
 
The result of this code looks like this:
  • This is an item
  • This is another item
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      A serial version UID
      See Also:
    • symbol

      private Chunk symbol
      this is the symbol that wil proceed the listitem.
  • Constructor Details

    • ListItem

      public ListItem()
      Constructs a ListItem.
    • ListItem

      public ListItem(float leading)
      Constructs a ListItem with a certain leading.
      Parameters:
      leading - the leading
    • ListItem

      public ListItem(Chunk chunk)
      Constructs a ListItem with a certain Chunk.
      Parameters:
      chunk - a Chunk
    • ListItem

      public ListItem(String string)
      Constructs a ListItem with a certain String.
      Parameters:
      string - a String
    • ListItem

      public ListItem(String string, Font font)
      Constructs a ListItem with a certain String and a certain Font.
      Parameters:
      string - a String
      font - a String
    • ListItem

      public ListItem(float leading, Chunk chunk)
      Constructs a ListItem with a certain Chunk and a certain leading.
      Parameters:
      leading - the leading
      chunk - a Chunk
    • ListItem

      public ListItem(float leading, String string)
      Constructs a ListItem with a certain String and a certain leading.
      Parameters:
      leading - the leading
      string - a String
    • ListItem

      public ListItem(float leading, String string, Font font)
      Constructs a ListItem with a certain leading, String and Font.
      Parameters:
      leading - the leading
      string - a String
      font - a Font
    • ListItem

      public ListItem(Phrase phrase)
      Constructs a ListItem with a certain Phrase.
      Parameters:
      phrase - a Phrase
    • ListItem

      public ListItem(Properties attributes)
      Returns a ListItem that has been constructed taking in account the value of some attributes.
      Parameters:
      attributes - Some attributes
  • Method Details

    • type

      public int type()
      Gets the type of the text element.
      Specified by:
      type in interface Element
      Overrides:
      type in class Paragraph
      Returns:
      a type
    • setListSymbol

      public void setListSymbol(Chunk symbol)
      Sets the listsymbol.
      Parameters:
      symbol - a Chunk
    • listSymbol

      public Chunk listSymbol()
      Returns the listsymbol.
      Returns:
      a Chunk
    • isTag

      public static boolean isTag(String tag)
      Checks if a given tag corresponds with this object.
      Parameters:
      tag - the given tag
      Returns:
      true if the tag corresponds