com.lowagie.text
public class List extends Object implements TextElementArray
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:
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 | |
|---|---|
| static boolean | ALPHABETICAL a possible value for the lettered parameter |
| protected boolean | alignindent Indicates if the indentation of all the items has to be aligned. |
| protected boolean | autoindent Indicates if the indentation has to be set automatically. |
| protected int | first This variable indicates the first number of a numbered list. |
| 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 boolean | lettered Indicates if the listsymbols are numerical or alphabetical. |
| protected ArrayList | list This is the ArrayList containing the different ListItems. |
| protected boolean | lowercase Indicates if the listsymbols are lowercase or uppercase. |
| static boolean | LOWERCASE a possible value for the lettered parameter |
| protected boolean | numbered Indicates if the list has to be numbered. |
| static boolean | NUMERICAL a possible value for the lettered parameter |
| static boolean | ORDERED a possible value for the numbered parameter |
| protected String | postSymbol
In case you are using numbered/lettered lists, this String is added after the number/letter. |
| protected String | preSymbol
In case you are using numbered/lettered lists, this String is added before the number/letter. |
| protected Chunk | symbol This is the listsymbol of a list that is not numbered. |
| protected float | symbolIndent The indentation of the listitems. |
| static boolean | UNORDERED a possible value for the numbered parameter |
| static boolean | UPPERCASE a possible value for the lettered parameter |
| Constructor Summary | |
|---|---|
| List() Constructs a List. | |
| List(float symbolIndent)
Constructs a List with a specific symbol indentation. | |
| List(boolean numbered)
Constructs a List. | |
| List(boolean numbered, boolean lettered)
Constructs a List. | |
| List(boolean numbered, float symbolIndent)
Constructs a List.
| |
| List(boolean numbered, boolean lettered, float symbolIndent)
Creates a list | |
| Method Summary | |
|---|---|
| boolean | add(Object o)
Adds an Object to the List.
|
| ArrayList | getChunks()
Gets all the chunks in this element.
|
| int | getFirst()
Gets the first number . |
| float | getIndentationLeft()
Gets the indentation of this paragraph on the left side. |
| float | getIndentationRight()
Gets the indentation of this paragraph on the right side. |
| ArrayList | getItems()
Gets all the items in the list.
|
| String | getPostSymbol()
Returns the String that is after a number or letter in the list symbol. |
| String | getPreSymbol()
Returns the String that is before a number or letter in the list symbol. |
| Chunk | getSymbol()
Gets the Chunk containing the symbol. |
| float | getSymbolIndent()
Gets the symbol indentation. |
| float | getTotalLeading()
Gets the leading of the first listitem.
|
| boolean | isAlignindent()
Checks if all the listitems should be aligned. |
| boolean | isAutoindent()
Checks if the indentation of list items is done automatically. |
| boolean | isContent() |
| boolean | isEmpty()
Returns true if the list is empty.
|
| boolean | isLettered()
Checks if the list is lettered. |
| boolean | isLowercase()
Checks if the list lettering is lowercase. |
| boolean | isNestable() |
| boolean | isNumbered()
Checks if the list is numbered. |
| void | normalizeIndentation() Makes sure all the items in the list have the same indentation. |
| boolean | process(ElementListener listener)
Processes the element by adding it (or the different parts) to an
ElementListener.
|
| void | setAlignindent(boolean alignindent) |
| void | setAutoindent(boolean autoindent) |
| void | setFirst(int first)
Sets the number that has to come first in the list.
|
| void | setIndentationLeft(float indentation)
Sets the indentation of this paragraph on the left side.
|
| void | setIndentationRight(float indentation)
Sets the indentation of this paragraph on the right side.
|
| void | setLettered(boolean lettered) |
| void | setListSymbol(Chunk symbol)
Sets the listsymbol.
|
| void | setListSymbol(String symbol)
Sets the listsymbol.
|
| void | setLowercase(boolean uppercase) |
| void | setNumbered(boolean numbered) |
| void | setPostSymbol(String postSymbol)
Sets the String that has to be added after a number or letter in the list symbol. |
| void | setPreSymbol(String preSymbol)
Sets the String that has to be added before a number or letter in the list symbol. |
| void | setSymbolIndent(float symbolIndent) |
| int | size()
Gets the size of the list.
|
| int | type()
Gets the type of the text element.
|
ArrayList containing the different ListItems.Since: iText 2.1.1
Since: iText 2.1.1
List.List with a specific symbol indentation.Parameters: symbolIndent the symbol indentation
Since: iText 2.0.8
List.Parameters: numbered a boolean
List.Parameters: numbered a boolean lettered has the list to be 'numbered' with letters
List.
Remark: the parameter symbolIndent is important for instance when generating PDF-documents; it indicates the indentation of the listsymbol. It is not important for HTML-documents.
Parameters: numbered a boolean symbolIndent the indentation that has to be used for the listsymbol
Parameters: numbered has the list to be numbered? lettered has the list to be 'numbered' with letters symbolIndent the indentation of the symbol
Object to the List.
Parameters: o the object to add.
Returns: true if adding the object succeeded
Returns: an ArrayList
Returns: a number
Returns: the indentation
Returns: the indentation
Returns: an ArrayList containing ListItems.
Returns: the String that is after a number or letter in the list symbol
Since: iText 2.1.1
Returns: the String that is before a number or letter in the list symbol
Since: iText 2.1.1
Returns: a Chunk with a symbol
Returns: the symbol indentation
Returns: a leading
Returns: the alignindent
Returns: the autoindent
Since: iText 2.0.8
See Also: isContent
true if the list is empty.
Returns: true if the list is empty
Returns: true if the list is lettered, false otherwise.
Returns: true if it is lowercase, false otherwise.
Since: iText 2.0.8
See Also: isNestable
Returns: true if the list is numbered, false otherwise.
ElementListener.
Parameters: listener an ElementListener
Returns: true if the element was processed successfully
Parameters: alignindent the alignindent to set
Parameters: autoindent the autoindent to set
Parameters: first a number
Parameters: indentation the new indentation
Parameters: indentation the new indentation
Parameters: lettered the lettered to set
Parameters: symbol a Chunk
This is a shortcut for setListSymbol(Chunk symbol).
Parameters: symbol a String
Parameters: uppercase the uppercase to set
Parameters: numbered the numbered to set
Parameters: postSymbol the String that has to be added after a number or letter in the list symbol.
Since: iText 2.1.1
Parameters: preSymbol the String that has to be added before a number or letter in the list symbol.
Since: iText 2.1.1
Parameters: symbolIndent the symbolIndent to set
Returns: a size
Returns: a type