Package com.lowagie.text
Class ListItem
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList
com.lowagie.text.Phrase
com.lowagie.text.Paragraph
com.lowagie.text.ListItem
- All Implemented Interfaces:
Element,TextElementArray,Serializable,Cloneable,Iterable,Collection,List,RandomAccess
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
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
- See Also:
-
Field Summary
Fields inherited from class com.lowagie.text.Paragraph
alignment, indentationLeft, indentationRight, keeptogether, multipliedLeading, spacingAfter, spacingBeforeFields inherited from class com.lowagie.text.Phrase
font, hyphenation, leadingFields inherited from class java.util.AbstractList
modCountFields 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, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK -
Constructor Summary
ConstructorsConstructorDescriptionListItem()Constructs aListItem.ListItem(float leading) Constructs aListItemwith a certain leading.Constructs aListItemwith a certainChunkand a certain leading.Constructs aListItemwith a certainStringand a certain leading.Constructs aListItemwith a certain leading,StringandFont.Constructs aListItemwith a certainChunk.Constructs aListItemwith a certainPhrase.Constructs aListItemwith a certainString.Constructs aListItemwith a certainStringand a certainFont. -
Method Summary
Modifier and TypeMethodDescriptionReturns the listsymbol.voidsetIndentationLeft(float indentation, boolean autoindent) Sets the indentation of this paragraph on the left side.voidsetListSymbol(Chunk symbol) Sets the listsymbol.inttype()Gets the type of the text element.Methods inherited from class com.lowagie.text.Paragraph
add, addParagraph, getAlignment, getExtraParagraphSpace, getFirstLineIndent, getIndentationLeft, getIndentationRight, getKeepTogether, getMultipliedLeading, getSpacingAfter, getSpacingBefore, getTotalLeading, setAlignment, setAlignment, setExtraParagraphSpace, setFirstLineIndent, setIndentationLeft, setIndentationRight, setKeepTogether, setLeading, setLeading, setMultipliedLeading, setSpacingAfter, setSpacingBefore, spacingAfter, spacingBeforeMethods inherited from class com.lowagie.text.Phrase
add, addAll, addChunk, addSpecial, getChunks, getContent, getFont, getHyphenation, getInstance, getInstance, getInstance, getLeading, hasLeading, isContent, isEmpty, isNestable, process, setFont, setHyphenationMethods inherited from class java.util.ArrayList
addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll
-
Constructor Details
-
ListItem
public ListItem()Constructs aListItem. -
ListItem
public ListItem(float leading) Constructs aListItemwith a certain leading.- Parameters:
leading- the leading
-
ListItem
Constructs aListItemwith a certainChunk.- Parameters:
chunk- aChunk
-
ListItem
Constructs aListItemwith a certainString.- Parameters:
string- aString
-
ListItem
Constructs aListItemwith a certainStringand a certainFont.- Parameters:
string- aStringfont- aString
-
ListItem
Constructs aListItemwith a certainChunkand a certain leading.- Parameters:
leading- the leadingchunk- aChunk
-
ListItem
Constructs aListItemwith a certainStringand a certain leading.- Parameters:
leading- the leadingstring- aString
-
ListItem
Constructs aListItemwith a certain leading,StringandFont.- Parameters:
leading- the leadingstring- aStringfont- aFont
-
ListItem
Constructs aListItemwith 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 indentation
-
getListSymbol
Returns the listsymbol.- Returns:
- a
Chunk
-