Home » iText-2.1.7 » com.lowagie » text » [javadoc | source]
com.lowagie.text
public class: List [javadoc | source]
java.lang.Object
   com.lowagie.text.List

All Implemented Interfaces:
    TextElementArray

Direct Known Subclasses:
    RomanList, ZapfDingbatsNumberList, GreekList, ZapfDingbatsList

A List contains several ListItems.

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:
Field Summary
public static final  boolean ORDERED    a possible value for the numbered parameter 
public static final  boolean UNORDERED    a possible value for the numbered parameter 
public static final  boolean NUMERICAL    a possible value for the lettered parameter 
public static final  boolean ALPHABETICAL    a possible value for the lettered parameter 
public static final  boolean UPPERCASE    a possible value for the lettered parameter 
public static final  boolean LOWERCASE    a possible value for the lettered parameter 
protected  ArrayList list    This is the ArrayList containing the different ListItems. 
protected  boolean numbered    Indicates if the list has to be numbered. 
protected  boolean lettered    Indicates if the listsymbols are numerical or alphabetical. 
protected  boolean lowercase    Indicates if the listsymbols are lowercase or uppercase. 
protected  boolean autoindent    Indicates if the indentation has to be set automatically. 
protected  boolean alignindent    Indicates if the indentation of all the items has to be aligned. 
protected  int first    This variable indicates the first number of a numbered list. 
protected  Chunk symbol    This is the listsymbol of a list that is not numbered. 
protected  String preSymbol    In case you are using numbered/lettered lists, this String is added before the number/letter.
    since: iText - 2.1.1
 
protected  String postSymbol    In case you are using numbered/lettered lists, this String is added after the number/letter.
    since: iText - 2.1.1
 
protected  float indentationLeft    The indentation of this list on the left side. 
protected  float indentationRight    The indentation of this list on the right side. 
protected  float symbolIndent    The indentation of the listitems. 
Constructor:
 public List() 
 public List(float symbolIndent) 
 public List(boolean numbered) 
 public List(boolean numbered,
    boolean lettered) 
 public List(boolean numbered,
    float symbolIndent) 
 public List(boolean numbered,
    boolean lettered,
    float symbolIndent) 
Method from com.lowagie.text.List Summary:
add,   getChunks,   getFirst,   getIndentationLeft,   getIndentationRight,   getItems,   getPostSymbol,   getPreSymbol,   getSymbol,   getSymbolIndent,   getTotalLeading,   isAlignindent,   isAutoindent,   isContent,   isEmpty,   isLettered,   isLowercase,   isNestable,   isNumbered,   normalizeIndentation,   process,   setAlignindent,   setAutoindent,   setFirst,   setIndentationLeft,   setIndentationRight,   setLettered,   setListSymbol,   setListSymbol,   setLowercase,   setNumbered,   setPostSymbol,   setPreSymbol,   setSymbolIndent,   size,   type
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.List Detail:
 public boolean add(Object o) 
    Adds an Object to the List.
 public ArrayList getChunks() 
    Gets all the chunks in this element.
 public int getFirst() 
    Gets the first number .
 public float getIndentationLeft() 
    Gets the indentation of this paragraph on the left side.
 public float getIndentationRight() 
    Gets the indentation of this paragraph on the right side.
 public ArrayList getItems() 
    Gets all the items in the list.
 public String getPostSymbol() 
    Returns the String that is after a number or letter in the list symbol.
 public String getPreSymbol() 
    Returns the String that is before a number or letter in the list symbol.
 public Chunk getSymbol() 
    Gets the Chunk containing the symbol.
 public float getSymbolIndent() 
    Gets the symbol indentation.
 public float getTotalLeading() 
    Gets the leading of the first listitem.
 public boolean isAlignindent() 
    Checks if all the listitems should be aligned.
 public boolean isAutoindent() 
    Checks if the indentation of list items is done automatically.
 public boolean isContent() 
 public boolean isEmpty() 
    Returns true if the list is empty.
 public boolean isLettered() 
    Checks if the list is lettered.
 public boolean isLowercase() 
    Checks if the list lettering is lowercase.
 public boolean isNestable() 
 public boolean isNumbered() 
    Checks if the list is numbered.
 public  void normalizeIndentation() 
    Makes sure all the items in the list have the same indentation.
 public boolean process(ElementListener listener) 
    Processes the element by adding it (or the different parts) to an ElementListener.
 public  void setAlignindent(boolean alignindent) 
 public  void setAutoindent(boolean autoindent) 
 public  void setFirst(int first) 
    Sets the number that has to come first in the list.
 public  void setIndentationLeft(float indentation) 
    Sets the indentation of this paragraph on the left side.
 public  void setIndentationRight(float indentation) 
    Sets the indentation of this paragraph on the right side.
 public  void setLettered(boolean lettered) 
 public  void setListSymbol(Chunk symbol) 
    Sets the listsymbol.
 public  void setListSymbol(String symbol) 
    Sets the listsymbol.

    This is a shortcut for setListSymbol(Chunk symbol).

 public  void setLowercase(boolean uppercase) 
 public  void setNumbered(boolean numbered) 
 public  void setPostSymbol(String postSymbol) 
    Sets the String that has to be added after a number or letter in the list symbol.
 public  void setPreSymbol(String preSymbol) 
    Sets the String that has to be added before a number or letter in the list symbol.
 public  void setSymbolIndent(float symbolIndent) 
 public int size() 
    Gets the size of the list.
 public int type() 
    Gets the type of the text element.