|
![]() |
||||||||
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 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");
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 java.util.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 |
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(java.util.Properties attributes)
Deprecated. use ElementFactory.getList(attributes); |
Method Summary | |
---|---|
boolean |
add(java.lang.Object o)
Adds an Object to the List . |
int |
first()
Deprecated. use getFirst(); |
java.util.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. |
java.util.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. use getIndentationLeft(); |
float |
indentationRight()
Deprecated. use getIndentationRight(); |
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()
Deprecated. use isLowercase(); |
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(java.lang.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. use getSymbol(); |
float |
symbolIndent()
Deprecated. use getSymbolIndent(); |
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 java.util.ArrayList list
ArrayList
containing the different ListItem
s.
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(boolean numbered)
List
.
numbered
- a booleanpublic List(boolean numbered, boolean lettered)
List
.
numbered
- a booleanlettered
- has the list to be 'numbered' with letterspublic 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 listsymbolpublic 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(java.util.Properties attributes)
List
that has been constructed taking in account
the value of some attributes.
attributes
- Some attributesMethod Detail |
---|
public boolean process(ElementListener listener)
ElementListener
.
process
in interface Element
listener
- an ElementListener
true
if the element was processed successfullypublic int type()
type
in interface Element
public java.util.ArrayList getChunks()
getChunks
in interface Element
ArrayList
public boolean add(java.lang.Object o)
Object
to the List
.
add
in interface TextElementArray
o
- 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 Chunk
public void setListSymbol(java.lang.String symbol)
This is a shortcut for setListSymbol(Chunk symbol)
.
symbol
- a String
public 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 java.util.ArrayList getItems()
ArrayList
containing ListItem
s.public int size()
size
public boolean isEmpty()
true
if the list is empty.
true
if the list is emptypublic float getTotalLeading()
leading
public 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 isLowerCase()
true
if it is lowercase, false
otherwise.public int first()
public Chunk symbol()
public float indentationLeft()
public float indentationRight()
public float symbolIndent()
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |