public class ListItem extends Paragraph
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"));
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
, List
, Paragraph
, Serialized Form
Modifier and Type | Field and Description |
---|---|
protected Chunk |
symbol
this is the symbol that will precede the listitem.
|
accessibleAttributes, alignment, id, indentationLeft, indentationRight, keeptogether, paddingTop, role, spacingAfter, spacingBefore
font, hyphenation, leading, multipliedLeading, tabSettings
modCount
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, BODY, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CHAPTER, CHUNK, CREATIONDATE, CREATOR, DIV, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LANGUAGE, LIST, LISTITEM, MARKED, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, SECTION, SUBJECT, TITLE, WRITABLE_DIRECT, YMARK
Constructor and Description |
---|
ListItem()
Constructs a ListItem .
|
ListItem(Chunk chunk)
Constructs a ListItem with a certain Chunk .
|
ListItem(float leading)
Constructs a ListItem with a certain leading.
|
ListItem(float leading, Chunk chunk)
Constructs a ListItem with a certain Chunk and a certain leading.
|
ListItem(float leading, String string)
Constructs a ListItem with a certain String and a certain leading.
|
ListItem(float leading, String string, Font font)
Constructs a ListItem with a certain leading, String and Font .
|
ListItem(Phrase phrase)
Constructs a ListItem with a certain Phrase .
|
ListItem(String string)
Constructs a ListItem with a certain String .
|
ListItem(String string, Font font)
Constructs a ListItem with a certain String and a certain Font .
|
Modifier and Type | Method and Description |
---|---|
void |
adjustListSymbolFont()
Changes the font of the list symbol to the font of the first chunk in the list item.
|
Paragraph |
cloneShallow(boolean spacingBefore)
Creates a shallow clone of the Paragraph.
|
ListBody |
getListBody() |
ListLabel |
getListLabel() |
Chunk |
getListSymbol()
Returns 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.
|
add, breakUp, getAccessibleAttribute, getAccessibleAttributes, getAlignment, getExtraParagraphSpace, getFirstLineIndent, getId, getIndentationLeft, getIndentationRight, getKeepTogether, getPaddingTop, getRole, getSpacingAfter, getSpacingBefore, isInline, populateProperties, setAccessibleAttribute, setAlignment, setExtraParagraphSpace, setFirstLineIndent, setId, setIndentationLeft, setIndentationRight, setKeepTogether, setPaddingTop, setRole, setSpacingAfter, setSpacingBefore, spacingAfter, spacingBefore
add, add, addAll, addChunk, addSpecial, getChunks, getContent, getFont, getHyphenation, getInstance, getInstance, getInstance, getLeading, getMultipliedLeading, getTabSettings, getTotalLeading, hasLeading, isContent, isEmpty, isNestable, process, setFont, setHyphenation, setLeading, setLeading, setMultipliedLeading, setTabSettings, trim
addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
protected Chunk symbol
public ListItem()
ListItem
.
public ListItem(float leading)
ListItem
with a certain leading.
leading
- the leading
public ListItem(Chunk chunk)
ListItem
with a certain Chunk
.
chunk
- a Chunk
public ListItem(String string)
ListItem
with a certain String
.
string
- a String
public ListItem(String string, Font font)
ListItem
with a certain String
and a certain Font
.
string
- a String
font
- a String
public ListItem(float leading, Chunk chunk)
ListItem
with a certain Chunk
and a certain leading.
leading
- the leading
chunk
- a Chunk
public ListItem(float leading, String string)
ListItem
with a certain String
and a certain leading.
leading
- the leading
string
- a String
public ListItem(float leading, String string, Font font)
ListItem
with a certain leading, String
and Font
.
leading
- the leading
string
- a String
font
- a Font
public ListItem(Phrase phrase)
ListItem
with a certain Phrase
.
phrase
- a Phrase
public int type()
public Paragraph cloneShallow(boolean spacingBefore)
Paragraph
cloneShallow
in class Paragraph
public void setListSymbol(Chunk symbol)
symbol
- a Chunk
public void setIndentationLeft(float indentation, boolean autoindent)
indentation
- the new indentation
autoindent
- if set to true, indentation is done automagically, the given indentation float is disregarded.
public void adjustListSymbolFont()
public Chunk getListSymbol()
Chunk
public ListBody getListBody()
public ListLabel getListLabel()
Copyright © 1998–2022. All rights reserved.