com.lowagie.text
public class: ListItem [javadoc |
source]
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
com.lowagie.text.Phrase
com.lowagie.text.Paragraph
com.lowagie.text.ListItem
All Implemented Interfaces:
TextElementArray, List, Serializable, RandomAccess, Cloneable, Collection
A
ListItem is a
Paragraph
that can be added to a
List.
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:
-
First line
-
The second line is longer to see what happens once the end of the line is reached. Will it start on a new line?
-
Third line
Example 2:
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:
-
This is an item
-
This is another item
| Constructor: |
public ListItem() {
// constructors
super();
}
|
public ListItem(float leading) {
super(leading);
}
Constructs a ListItem with a certain leading. Parameters:
leading - the leading
|
public ListItem(Chunk chunk) {
super(chunk);
}
Constructs a ListItem with a certain Chunk. Parameters:
chunk - a Chunk
|
public ListItem(String string) {
super(string);
}
Constructs a ListItem with a certain String. Parameters:
string - a String
|
public ListItem(Phrase phrase) {
super(phrase);
}
Constructs a ListItem with a certain Phrase. Parameters:
phrase - a Phrase
|
public ListItem(String string,
Font font) {
super(string, font);
}
Constructs a ListItem with a certain String
and a certain Font. Parameters:
string - a String
font - a String
|
public ListItem(float leading,
Chunk chunk) {
super(leading, chunk);
}
Constructs a ListItem with a certain Chunk
and a certain leading. Parameters:
leading - the leading
chunk - a Chunk
|
public ListItem(float leading,
String string) {
super(leading, string);
}
Constructs a ListItem with a certain String
and a certain leading. Parameters:
leading - the leading
string - a String
|
public ListItem(float leading,
String string,
Font font) {
super(leading, string, font);
}
Constructs a ListItem with a certain leading, String
and Font. Parameters:
leading - the leading
string - a String
font - a Font
|
| Methods from com.lowagie.text.Paragraph: |
|---|
|
add, getAlignment, getExtraParagraphSpace, getFirstLineIndent, getIndentationLeft, getIndentationRight, getKeepTogether, getMultipliedLeading, getTotalLeading, setAlignment, setAlignment, setExtraParagraphSpace, setFirstLineIndent, setIndentationLeft, setIndentationRight, setKeepTogether, setLeading, setLeading, setMultipliedLeading, setSpacingAfter, setSpacingBefore, spacingAfter, spacingBefore, type |
| Methods from com.lowagie.text.Phrase: |
|---|
|
add, add, addAll, addChunk, addSpecial, getChunks, getContent, getFont, getHyphenation, getInstance, getInstance, getInstance, getLeading, hasLeading, isContent, isEmpty, isNestable, process, setFont, setHyphenation, setLeading, type |
| Methods from java.util.ArrayList: |
|---|
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize |
| Methods from java.util.AbstractList: |
|---|
|
add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, set, subList |
| Methods from java.util.AbstractCollection: |
|---|
|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
| Method from com.lowagie.text.ListItem Detail: |
public Chunk getListSymbol() {
return symbol;
}
|
public void setIndentationLeft(float indentation,
boolean autoindent) {
if (autoindent) {
setIndentationLeft(getListSymbol().getWidthPoint());
}
else {
setIndentationLeft(indentation);
}
}
Sets the indentation of this paragraph on the left side. |
public void setListSymbol(Chunk symbol) {
if (this.symbol == null) {
this.symbol = symbol;
if (this.symbol.getFont().isStandardFont()) {
this.symbol.setFont(font);
}
}
}
|
public int type() {
return Element.LISTITEM;
}
Gets the type of the text element. |