com.lowagie.text
public class List extends Object implements TextElementArray
List
contains several ListItem
s.
Example 1:
The result of this code looks like this: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");
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 ListItem s. |
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 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(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 | |
List(Properties attributes)
Returns a List that has been constructed taking in account
the value of some attributes.
|
Method Summary | |
---|---|
boolean | add(Object o)
Adds an Object to the List .
|
int | first()
Gets the first number . |
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.
|
Chunk | getSymbol()
Gets the Chunk containing the symbol. |
float | getSymbolIndent()
Gets the symbol indentation. |
float | getTotalLeading()
Gets the leading of the first listitem.
|
float | indentationLeft()
Gets the indentation of this paragraph on the left side. |
float | indentationRight()
Gets the indentation of this paragraph on the right side. |
boolean | isAlignindent()
Checks if all the listitems should be aligned. |
boolean | isAutoindent()
Checks if the indentation of list items is done automatically. |
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 | isLowerCase()
Checks if the list lettering is lowercase. |
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 | setSymbolIndent(float symbolIndent) |
int | size()
Gets the size of the list.
|
Chunk | symbol()
Gets the Chunk containing the symbol. |
float | symbolIndent()
Gets the symbol indentation. |
int | type()
Gets the type of the text element.
|
ArrayList
containing the different ListItem
s.List
.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
Deprecated: use ElementFactory.getList(attributes);
Returns aList
that has been constructed taking in account
the value of some attributes.
Parameters: attributes Some attributes
Object
to the List
.
Parameters: o the object to add.
Returns: true if adding the object succeeded
Deprecated: use getFirst();
Gets the first number .Returns: a number
Returns: an ArrayList
Returns: a number
Returns: the indentation
Returns: the indentation
Returns: an ArrayList
containing ListItem
s.
Returns: a Chunk with a symbol
Returns: the symbol indentation
Returns: a leading
Deprecated: use getIndentationLeft();
Gets the indentation of this paragraph on the left side.Returns: the indentation
Deprecated: use getIndentationRight();
Gets the indentation of this paragraph on the right side.Returns: the indentation
Returns: the alignindent
Returns: the autoindent
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.
Deprecated: use isLowercase();
Checks if the list lettering is lowercase.Returns: true
if it is lowercase, false
otherwise.
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: symbolIndent the symbolIndent to set
Returns: a size
Deprecated: use getSymbol();
Gets the Chunk containing the symbol.Returns: a Chunk with a symbol
Deprecated: use getSymbolIndent();
Gets the symbol indentation.Returns: the symbol indentation
Returns: a type