Package com.itextpdf.layout.element
Class List
- java.lang.Object
-
- All Implemented Interfaces:
IAbstractElement
,IBlockElement
,IElement
,IPropertyContainer
,IAccessibleElement
public class List extends BlockElement<List>
A List is a layout element representing a series of objects that are vertically outlined with the same or very similar layout properties, giving it a sense of unity. It containsListItem
objects that can optionally be prefixed with a symbol and/or numbered.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_LIST_SYMBOL
protected DefaultAccessibilityProperties
tagProperties
-
Fields inherited from class com.itextpdf.layout.element.AbstractElement
childElements, nextRenderer, styles
-
Fields inherited from class com.itextpdf.layout.ElementPropertyContainer
properties
-
-
Constructor Summary
Constructors Constructor Description List()
Creates a List with theDEFAULT_LIST_SYMBOL
as a prefix.List(ListNumberingType listNumberingType)
Creates a List with a custom numbering type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List
add(ListItem listItem)
Adds a newListItem
to the bottom of the List.List
add(java.lang.String text)
Adds a newListItem
to the bottom of the List.AccessibilityProperties
getAccessibilityProperties()
Gets theaccessibility properties
.<T1> T1
getDefaultProperty(int property)
Gets the default property from this entity.java.lang.String
getPostSymbolText()
Gets the piece of text that is added after theListItem
symbol.java.lang.String
getPreSymbolText()
Gets the piece of text that is added before theListItem
symbol.java.lang.Float
getSymbolIndent()
Gets the indent offset of theListItem
symbols.protected IRenderer
makeNewRenderer()
Creates new renderer instance.List
setItemStartIndex(int start)
Customizes the index of the first item in the list.List
setListSymbol(Image image)
Sets the list symbol to be used.List
setListSymbol(Text text)
Sets the list symbol to be used.List
setListSymbol(ListNumberingType listNumberingType)
Sets the list numbering type to be used.List
setListSymbol(java.lang.String symbol)
Sets the list symbol to be used.List
setListSymbolAlignment(ListSymbolAlignment alignment)
A specialized enum containing alignment properties for list symbols.void
setPostSymbolText(java.lang.String postSymbolText)
Sets a piece of text that should be added after theListItem
symbol.void
setPreSymbolText(java.lang.String preSymbolText)
Sets a piece of text that should be added before theListItem
symbol.List
setSymbolIndent(float symbolIndent)
Sets the indent offset of theListItem
symbols.-
Methods inherited from class com.itextpdf.layout.element.BlockElement
getHeight, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getWidth, isKeepTogether, isKeepWithNext, setHeight, setHeight, setKeepTogether, setKeepWithNext, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMargins, setMarginTop, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setNeutralRole, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddings, setPaddingTop, setRotationAngle, setRotationAngle, setSpacingRatio, setVerticalAlignment, setWidth, setWidth
-
Methods inherited from class com.itextpdf.layout.element.AbstractElement
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, setAction, setNextRenderer, setPageNumber
-
Methods inherited from class com.itextpdf.layout.ElementPropertyContainer
deleteOwnProperty, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBaseDirection, setBold, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.itextpdf.layout.element.IAbstractElement
getChildren
-
Methods inherited from interface com.itextpdf.layout.element.IElement
createRendererSubTree, getRenderer, setNextRenderer
-
Methods inherited from interface com.itextpdf.layout.IPropertyContainer
deleteOwnProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setProperty
-
-
-
-
Field Detail
-
DEFAULT_LIST_SYMBOL
public static final java.lang.String DEFAULT_LIST_SYMBOL
- See Also:
- Constant Field Values
-
tagProperties
protected DefaultAccessibilityProperties tagProperties
-
-
Constructor Detail
-
List
public List()
Creates a List with theDEFAULT_LIST_SYMBOL
as a prefix.
-
List
public List(ListNumberingType listNumberingType)
Creates a List with a custom numbering type.- Parameters:
listNumberingType
- a prefix style
-
-
Method Detail
-
getDefaultProperty
public <T1> T1 getDefaultProperty(int property)
Description copied from interface:IPropertyContainer
Gets the default property from this entity.- Specified by:
getDefaultProperty
in interfaceIPropertyContainer
- Overrides:
getDefaultProperty
in classBlockElement<List>
- Type Parameters:
T1
- the return type associated with the property- Parameters:
property
- the property to be retrieved- Returns:
- the default property value. If the default property is not defined,
null
will be returned
-
add
public List add(ListItem listItem)
Adds a newListItem
to the bottom of the List.- Parameters:
listItem
- a new list item- Returns:
- this list.
-
add
public List add(java.lang.String text)
Adds a newListItem
to the bottom of the List.- Parameters:
text
- textual contents of the new list item- Returns:
- this list.
-
setItemStartIndex
public List setItemStartIndex(int start)
Customizes the index of the first item in the list.- Parameters:
start
- the custom index, as anint
- Returns:
- this list.
-
setListSymbol
public List setListSymbol(java.lang.String symbol)
Sets the list symbol to be used. This will create an unordered list, i.e. alllist items
will be shown with the same prefix.- Parameters:
symbol
- the textual symbol to be used for all items.- Returns:
- this list.
-
setListSymbol
public List setListSymbol(Text text)
Sets the list symbol to be used. This will create an unordered list, i.e. alllist items
will be shown with the same prefix.- Parameters:
text
- theText
object to be used for all items.- Returns:
- this list.
-
setListSymbol
public List setListSymbol(Image image)
Sets the list symbol to be used. This will create an unordered list, i.e. alllist items
will be shown with the same prefix.- Parameters:
image
- theImage
object to be used for all items.- Returns:
- this list.
-
setListSymbol
public List setListSymbol(ListNumberingType listNumberingType)
Sets the list numbering type to be used. This will create an ordered list, i.e. everyListItem
will have a unique prefix.- Parameters:
listNumberingType
- theListNumberingType
that will generate appropriate prefixes for theListItem
s.- Returns:
- this list.
-
setListSymbolAlignment
public List setListSymbolAlignment(ListSymbolAlignment alignment)
A specialized enum containing alignment properties for list symbols.ListSymbolAlignment.LEFT
means that the items will be aligned as follows: 9. Item 9 10. Item 10Whereas
ListSymbolAlignment.RIGHT
means the items will be aligned as follows: 9. Item 9 10. Item 10- Parameters:
alignment
- the alignment of the list symbols- Returns:
- this element
-
getSymbolIndent
public java.lang.Float getSymbolIndent()
Gets the indent offset of theListItem
symbols.- Returns:
- the indent offset as a
float
.
-
setSymbolIndent
public List setSymbolIndent(float symbolIndent)
Sets the indent offset of theListItem
symbols.- Parameters:
symbolIndent
- the new indent offset.- Returns:
- this list.
-
getPostSymbolText
public java.lang.String getPostSymbolText()
Gets the piece of text that is added after theListItem
symbol.- Returns:
- the post symbol text
-
setPostSymbolText
public void setPostSymbolText(java.lang.String postSymbolText)
Sets a piece of text that should be added after theListItem
symbol.- Parameters:
postSymbolText
- the post symbol text
-
getPreSymbolText
public java.lang.String getPreSymbolText()
Gets the piece of text that is added before theListItem
symbol.- Returns:
- the pre symbol text
-
setPreSymbolText
public void setPreSymbolText(java.lang.String preSymbolText)
Sets a piece of text that should be added before theListItem
symbol.- Parameters:
preSymbolText
- the pre symbol text
-
getAccessibilityProperties
public AccessibilityProperties getAccessibilityProperties()
Description copied from interface:IAccessibleElement
Gets theaccessibility properties
. See alsoIAccessibleElement
.- Returns:
- an interface that allows to specify properties of a tagged element in Tagged PDF.
-
makeNewRenderer
protected IRenderer makeNewRenderer()
Description copied from class:AbstractElement
Creates new renderer instance.- Specified by:
makeNewRenderer
in classAbstractElement<List>
- Returns:
- new
IRenderer
-
-