|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.lowagie.text.List
public class List
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:
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:
Element,
ListItem| Field Summary | |
|---|---|
protected boolean |
alignindent
Indicates if the indentation of all the items has to be aligned. |
static boolean |
ALPHABETICAL
a possible value for the lettered parameter |
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 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 |
| Fields inherited from interface com.lowagie.text.Element |
|---|
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, HEADER, IMGRAW, IMGTEMPLATE, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE |
| Constructor Summary | |
|---|---|
List()
Constructs a List. |
|
List(boolean numbered)
Constructs a List. |
|
List(boolean numbered,
boolean lettered)
Constructs a List. |
|
List(boolean numbered,
boolean lettered,
float symbolIndent)
Creates a list |
|
List(boolean numbered,
float symbolIndent)
Constructs a List. |
|
List(float symbolIndent)
Constructs a List with a specific symbol indentation. |
|
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()
Deprecated. As of iText 2.0.3, replaced by getFirst(),
scheduled for removal at 2.1.0 |
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()
Deprecated. As of iText 2.0.3, replaced by getIndentationLeft(),
scheduled for removal at 2.1.0 |
float |
indentationRight()
Deprecated. As of iText 2.0.3, replaced by getIndentationRight(),
scheduled for removal at 2.1.0 |
boolean |
isAlignindent()
Checks if all the listitems should be aligned. |
boolean |
isAutoindent()
Checks if the indentation of list items is done automatically. |
boolean |
isContent()
Checks if this element is a content object. |
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()
Deprecated. As of iText 2.0.3, replaced by isLowercase(),
scheduled for removal at 2.1.0 |
boolean |
isNestable()
Checks if this element is nestable. |
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()
Deprecated. As of iText 2.0.3, replaced by getSymbol(),
scheduled for removal at 2.1.0 |
float |
symbolIndent()
Deprecated. As of iText 2.0.3, replaced by getSymbolIndent(),
scheduled for removal at 2.1.0 |
int |
type()
Gets the type of the text element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.lowagie.text.Element |
|---|
toString |
| Field Detail |
|---|
public static final boolean ORDERED
public static final boolean UNORDERED
public static final boolean NUMERICAL
public static final boolean ALPHABETICAL
public static final boolean UPPERCASE
public static final boolean LOWERCASE
protected ArrayList list
ArrayList containing the different ListItems.
protected boolean numbered
protected boolean lettered
protected boolean lowercase
protected boolean autoindent
protected boolean alignindent
protected int first
protected Chunk symbol
protected float indentationLeft
protected float indentationRight
protected float symbolIndent
| Constructor Detail |
|---|
public List()
List.
public List(float symbolIndent)
List with a specific symbol indentation.
symbolIndent - the symbol indentationpublic List(boolean numbered)
List.
numbered - a boolean
public List(boolean numbered,
boolean lettered)
List.
numbered - a booleanlettered - has the list to be 'numbered' with letters
public List(boolean numbered,
float symbolIndent)
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.
numbered - a booleansymbolIndent - the indentation that has to be used for the listsymbol
public List(boolean numbered,
boolean lettered,
float symbolIndent)
numbered - has the list to be numbered?lettered - has the list to be 'numbered' with letterssymbolIndent - the indentation of the symbolpublic List(Properties attributes)
List that has been constructed taking in account
the value of some attributes.
attributes - Some attributes
* @deprecated As of iText 2.0.3, replaced by ElementFactory.getList(Properties),
scheduled for removal at 2.1.0| Method Detail |
|---|
public boolean process(ElementListener listener)
ElementListener.
process in interface Elementlistener - an ElementListener
true if the element was processed successfullypublic int type()
type in interface Elementpublic ArrayList getChunks()
getChunks in interface ElementArrayListpublic boolean add(Object o)
Object to the List.
add in interface TextElementArrayo - the object to add.
public void normalizeIndentation()
public void setNumbered(boolean numbered)
numbered - the numbered to setpublic void setLettered(boolean lettered)
lettered - the lettered to setpublic void setLowercase(boolean uppercase)
uppercase - the uppercase to setpublic void setAutoindent(boolean autoindent)
autoindent - the autoindent to setpublic void setAlignindent(boolean alignindent)
alignindent - the alignindent to setpublic void setFirst(int first)
first - a numberpublic void setListSymbol(Chunk symbol)
symbol - a Chunkpublic void setListSymbol(String symbol)
This is a shortcut for setListSymbol(Chunk symbol).
symbol - a Stringpublic void setIndentationLeft(float indentation)
indentation - the new indentationpublic void setIndentationRight(float indentation)
indentation - the new indentationpublic void setSymbolIndent(float symbolIndent)
symbolIndent - the symbolIndent to setpublic ArrayList getItems()
ArrayList containing ListItems.public int size()
sizepublic boolean isEmpty()
true if the list is empty.
true if the list is emptypublic float getTotalLeading()
leadingpublic boolean isNumbered()
true if the list is numbered, false otherwise.public boolean isLettered()
true if the list is lettered, false otherwise.public boolean isLowercase()
true if it is lowercase, false otherwise.public boolean isAutoindent()
public boolean isAlignindent()
public int getFirst()
public Chunk getSymbol()
public float getIndentationLeft()
public float getIndentationRight()
public float getSymbolIndent()
public boolean isContent()
Element
isContent in interface ElementElement.isContent()public boolean isNestable()
Element
isNestable in interface ElementElement.isNestable()public boolean isLowerCase()
isLowercase(),
scheduled for removal at 2.1.0
true if it is lowercase, false otherwise.public int first()
getFirst(),
scheduled for removal at 2.1.0
public Chunk symbol()
getSymbol(),
scheduled for removal at 2.1.0
public float indentationLeft()
getIndentationLeft(),
scheduled for removal at 2.1.0
public float indentationRight()
getIndentationRight(),
scheduled for removal at 2.1.0
public float symbolIndent()
getSymbolIndent(),
scheduled for removal at 2.1.0
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||