Package com.aowagie.text
Class ListItem
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList
-
- com.aowagie.text.Phrase
-
- com.aowagie.text.Paragraph
-
- com.aowagie.text.ListItem
-
- All Implemented Interfaces:
Element,TextElementArray,java.io.Serializable,java.lang.Cloneable,java.lang.Iterable,java.util.Collection,java.util.List,java.util.RandomAccess
public class ListItem extends Paragraph
AListItemis aParagraphthat can be added to aList.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:
Element,List,Paragraph, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUIDprivate Chunksymbolthis is the symbol that will precede the listitem.-
Fields inherited from interface com.aowagie.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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChunkgetListSymbol()Returns the listsymbol.(package private) 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.aowagie.text.Paragraph
add, getAlignment, getExtraParagraphSpace, getFirstLineIndent, getIndentationLeft, getIndentationRight, getKeepTogether, getMultipliedLeading, getSpacingAfter, getSpacingBefore, getTotalLeading, setAlignment, setAlignment, setExtraParagraphSpace, setFirstLineIndent, setIndentationLeft, setIndentationRight, setKeepTogether, setLeading, setMultipliedLeading, setSpacingAfter, setSpacingBefore
-
Methods inherited from class com.aowagie.text.Phrase
add, addAll, addSpecial, getChunks, getContent, getFont, getHyphenation, getLeading, hasLeading, isContent, isEmpty, isNestable, process, setFont, setHyphenation
-
Methods 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, trimToSize
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
symbol
private Chunk symbol
this is the symbol that will precede the listitem.
-
-
Constructor Detail
-
ListItem
public ListItem()
Constructs aListItem.
-
ListItem
ListItem(java.lang.String string)
Constructs aListItemwith a certainString.- Parameters:
string- aString
-
ListItem
public ListItem(Phrase phrase)
Constructs aListItemwith a certainPhrase.- Parameters:
phrase- aPhrase
-
-
Method Detail
-
type
public int type()
Gets the type of the text element.
-
setListSymbol
public void setListSymbol(Chunk symbol)
Sets the listsymbol.- Parameters:
symbol- aChunk
-
setIndentationLeft
void setIndentationLeft(float indentation, boolean autoindent)Sets the indentation of this paragraph on the left side.- Parameters:
indentation- the new indentationautoindent- Autoindent
-
getListSymbol
public Chunk getListSymbol()
Returns the listsymbol.- Returns:
- a
Chunk
-
-