|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lowagie.text.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 int |
first
This variable indicates the first number of a numbered list. |
protected char |
firstCh
|
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 char |
lastCh
|
protected boolean |
lettered
|
protected ArrayList |
list
This is the ArrayList containing the different ListItems. |
protected Properties |
markupAttributes
Contains extra markupAttributes |
protected boolean |
numbered
This variable indicates if the list has to be numbered. |
protected Chunk |
symbol
This is the listsymbol of a list that is not numbered. |
protected int |
symbolIndent
The indentation of the listitems. |
| 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, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE |
| Constructor Summary | |
List(boolean numbered,
boolean lettered,
int symbolIndent)
|
|
List(boolean numbered,
int symbolIndent)
Constructs 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. |
ArrayList |
getItems()
Gets all the items in the list. |
String |
getMarkupAttribute(String name)
Returns the value of the specified attribute. |
Set |
getMarkupAttributeNames()
Returns a Set of String attribute names for the
MarkupAttributes implementor. |
Properties |
getMarkupAttributes()
Return a Properties-object containing all the markupAttributes. |
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 |
isNumbered()
Checks if the list is numbered. |
static boolean |
isSymbol(String tag)
Checks if a given tag corresponds with the listsymbol tag of this object. |
static boolean |
isTag(String tag)
Checks if a given tag corresponds with this object. |
float |
leading()
Gets the leading of the first listitem. |
private String |
nextLetter()
Retrieves the next letter in the sequence |
boolean |
process(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener. |
void |
setFirst(char first)
Sets the Letter that has to come first in the list. |
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 |
setListSymbol(Chunk symbol)
Sets the listsymbol. |
void |
setListSymbol(String symbol)
Sets the listsymbol. |
void |
setMarkupAttribute(String name,
String value)
Sets the specified attribute. |
void |
setMarkupAttributes(Properties markupAttributes)
Sets the markupAttributes. |
int |
size()
Gets the size of the list. |
Chunk |
symbol()
Gets the symbol indentation. |
int |
symbolIndent()
Gets the symbol indentation. |
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 |
protected ArrayList list
ArrayList containing the different ListItems.
protected boolean numbered
protected boolean lettered
protected int first
protected char firstCh
protected char lastCh
protected Chunk symbol
protected float indentationLeft
protected float indentationRight
protected int symbolIndent
protected Properties markupAttributes
| Constructor Detail |
public List(boolean numbered,
int 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,
int symbolIndent)
public List(Properties attributes)
List that has been constructed taking in account
the value of some attributes.
attributes - Some attributes| 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.
true if the addition succeeded; false otherwisepublic void setIndentationLeft(float indentation)
indentation - the new indentationpublic void setIndentationRight(float indentation)
indentation - the new indentationpublic void setFirst(int first)
first - a numberpublic void setFirst(char first)
first - a letterpublic void setListSymbol(Chunk symbol)
symbol - a Chunkpublic void setListSymbol(String symbol)
This is a shortcut for setListSymbol(Chunk symbol).
symbol - a Stringpublic ArrayList getItems()
ArrayList containing ListItems.public int size()
sizepublic float leading()
leadingpublic boolean isNumbered()
true if the list is numbered, false otherwise.public int symbolIndent()
public Chunk symbol()
public int first()
public float indentationLeft()
public float indentationRight()
public static boolean isSymbol(String tag)
tag - the given tag
public static boolean isTag(String tag)
tag - the given tag
private String nextLetter()
public void setMarkupAttribute(String name,
String value)
MarkupAttributes
setMarkupAttribute in interface MarkupAttributesname - String attribute name.value - String attribute value.MarkupAttributes.setMarkupAttribute(java.lang.String, java.lang.String)public void setMarkupAttributes(Properties markupAttributes)
MarkupAttributes
setMarkupAttributes in interface MarkupAttributesmarkupAttributes - a Properties-object containing markupattributesMarkupAttributes.setMarkupAttributes(java.util.Properties)public String getMarkupAttribute(String name)
MarkupAttributes
getMarkupAttribute in interface MarkupAttributesname - String attribute name.
String.MarkupAttributes.getMarkupAttribute(java.lang.String)public Set getMarkupAttributeNames()
MarkupAttributesSet of String attribute names for the
MarkupAttributes implementor.
getMarkupAttributeNames in interface MarkupAttributesSet.MarkupAttributes.getMarkupAttributeNames()public Properties getMarkupAttributes()
MarkupAttributesProperties-object containing all the markupAttributes.
getMarkupAttributes in interface MarkupAttributesPropertiesMarkupAttributes.getMarkupAttributes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||