Package com.lowagie.text
Class ListItem
java.lang.Object
java.util.AbstractCollection<Element>
java.util.AbstractList<Element>
java.util.ArrayList<Element>
com.lowagie.text.Phrase
com.lowagie.text.Paragraph
com.lowagie.text.ListItem
- All Implemented Interfaces:
Element
,TextElementArray
,Serializable
,Cloneable
,Iterable<Element>
,Collection<Element>
,List<Element>
,RandomAccess
,SequencedCollection<Element>
A
ListItem
is a Paragraph
that can be added to a List
.
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"));
- 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
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");
- This is an item
- This is another item
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Chunk
this is the symbol that will precede the listitem.Fields inherited from class com.lowagie.text.Paragraph
alignment, indentationLeft, indentationRight, keeptogether, multipliedLeading, runDirection, spacingAfter, spacingBefore
Fields inherited from class com.lowagie.text.Phrase
font, hyphenation, leading
Fields inherited from class java.util.AbstractList
modCount
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, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK
-
Constructor Summary
ConstructorsConstructorDescriptionListItem()
Constructs aListItem
.ListItem
(float leading) Constructs aListItem
with a certain leading.Constructs aListItem
with a certainChunk
and a certain leading.Constructs aListItem
with a certainString
and a certain leading.Constructs aListItem
with a certain leading,String
andFont
.Constructs aListItem
with a certainChunk
.Constructs aListItem
with a certainPhrase
.Constructs aListItem
with a certainString
.Constructs aListItem
with a certainString
and a certainFont
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the listsymbol.void
setIndentationLeft
(float indentation, boolean autoindent) Sets the indentation of this paragraph on the left side.void
setListSymbol
(Chunk symbol) Sets the listsymbol.int
type()
Gets the type of the text element.Methods inherited from class com.lowagie.text.Paragraph
add, getAlignment, getExtraParagraphSpace, getFirstLineIndent, getIndentationLeft, getIndentationRight, getKeepTogether, getMultipliedLeading, getRunDirection, getSpacingAfter, getSpacingBefore, getTotalLeading, setAlignment, setAlignment, setExtraParagraphSpace, setFirstLineIndent, setIndentationLeft, setIndentationRight, setKeepTogether, setLeading, setLeading, setMultipliedLeading, setRunDirection, setSpacingAfter, setSpacingBefore, spacingAfter, spacingBefore
Methods inherited from class com.lowagie.text.Phrase
add, add, addAll, addChunk, addSpecial, getChunks, getContent, getFont, getHyphenation, getInstance, getInstance, getInstance, getLeading, hasLeading, isContent, isEmpty, isNestable, process, setFont, setHyphenation
Methods inherited from class java.util.ArrayList
addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
symbol
this is the symbol that will precede the listitem.- Since:
- 5.0 used to be private
-
-
Constructor Details
-
ListItem
public ListItem()Constructs aListItem
. -
ListItem
public ListItem(float leading) Constructs aListItem
with a certain leading.- Parameters:
leading
- the leading
-
ListItem
Constructs aListItem
with a certainChunk
.- Parameters:
chunk
- aChunk
-
ListItem
Constructs aListItem
with a certainString
.- Parameters:
string
- aString
-
ListItem
Constructs aListItem
with a certainString
and a certainFont
.- Parameters:
string
- aString
font
- aString
-
ListItem
Constructs aListItem
with a certainChunk
and a certain leading.- Parameters:
leading
- the leadingchunk
- aChunk
-
ListItem
Constructs aListItem
with a certainString
and a certain leading.- Parameters:
leading
- the leadingstring
- aString
-
ListItem
Constructs aListItem
with a certain leading,String
andFont
.- Parameters:
leading
- the leadingstring
- aString
font
- aFont
-
ListItem
Constructs aListItem
with a certainPhrase
.- Parameters:
phrase
- aPhrase
-
-
Method Details
-
type
public int type()Gets the type of the text element. -
setListSymbol
Sets the listsymbol.- Parameters:
symbol
- aChunk
-
setIndentationLeft
public void setIndentationLeft(float indentation, boolean autoindent) Sets the indentation of this paragraph on the left side.- Parameters:
indentation
- the new indentationautoindent
- if auto indentation, if set astrue
indentation
will not be used
-
getListSymbol
Returns the listsymbol.- Returns:
- a
Chunk
-