Package com.itextpdf.layout.element
Class List
- All Implemented Interfaces:
-
IAbstractElement
,IBlockElement
,IElement
,IPropertyContainer
,IAccessibleElement
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 contains
ListItem
objects that can optionally be prefixed with a symbol and/or numbered.
-
Field Summary
Fields inherited from class com.itextpdf.layout.element.AbstractElement
childElements, nextRenderer, styles
Fields inherited from class com.itextpdf.layout.ElementPropertyContainer
properties
-
Constructor Summary
ConstructorDescriptionList()
Creates a List with theDEFAULT_LIST_SYMBOL
as a prefix.List
(ListNumberingType listNumberingType) Creates a List with a custom numbering type. -
Method Summary
Modifier and TypeMethodDescriptionAdds a newListItem
to the bottom of the List.Adds a newListItem
to the bottom of the List.Gets theaccessibility properties
.T1 getDefaultProperty
(int property) Gets the default property from this entity.Gets the piece of text that is added after theListItem
symbol.Gets the piece of text that is added before theListItem
symbol.Gets the indent offset of theListItem
symbols.protected IRenderer
Creates new renderer instance.setItemStartIndex
(int start) Customizes the index of the first item in the list.setListSymbol
(Image image) Sets the list symbol to be used.setListSymbol
(Text text) Sets the list symbol to be used.setListSymbol
(ListNumberingType listNumberingType) Sets the list numbering type to be used.setListSymbol
(String symbol) Sets the list symbol to be used.setListSymbolAlignment
(ListSymbolAlignment alignment) A specialized enum containing alignment properties for list symbols.void
setPostSymbolText
(String postSymbolText) Sets a piece of text that should be added after theListItem
symbol.void
setPreSymbolText
(String preSymbolText) Sets a piece of text that should be added before theListItem
symbol.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, 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, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing, simulateBold, simulateItalic
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 Details
-
DEFAULT_LIST_SYMBOL
- See Also:
-
tagProperties
-
-
Constructor Details
-
List
public List()Creates a List with theDEFAULT_LIST_SYMBOL
as a prefix. -
List
Creates a List with a custom numbering type.- Parameters:
-
listNumberingType
- a prefix style
-
-
Method Details
-
getDefaultProperty
publicT1 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
Adds a newListItem
to the bottom of the List.- Parameters:
-
listItem
- a new list item - Returns:
- this list.
-
add
Adds a newListItem
to the bottom of the List.- Parameters:
-
text
- textual contents of the new list item - Returns:
- this list.
-
setItemStartIndex
Customizes the index of the first item in the list.- Parameters:
-
start
- the custom index, as anint
- Returns:
- this list.
-
setListSymbol
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
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
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
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
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
Gets the indent offset of theListItem
symbols.- Returns:
-
the indent offset as a
float
.
-
setSymbolIndent
Sets the indent offset of theListItem
symbols.- Parameters:
-
symbolIndent
- the new indent offset. - Returns:
- this list.
-
getPostSymbolText
Gets the piece of text that is added after theListItem
symbol.- Returns:
- the post symbol text
-
setPostSymbolText
Sets a piece of text that should be added after theListItem
symbol.- Parameters:
-
postSymbolText
- the post symbol text
-
getPreSymbolText
Gets the piece of text that is added before theListItem
symbol.- Returns:
- the pre symbol text
-
setPreSymbolText
Sets a piece of text that should be added before theListItem
symbol.- Parameters:
-
preSymbolText
- the pre symbol text
-
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
Description copied from class:AbstractElement
Creates new renderer instance.- Specified by:
-
makeNewRenderer
in classAbstractElement<List>
- Returns:
-
new
IRenderer
-