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 containsListItemobjects that can optionally be prefixed with a symbol and/or numbered.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_LIST_SYMBOLprotected DefaultAccessibilityPropertiestagProperties-
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_SYMBOLas 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 Listadd(ListItem listItem)Adds a newListItemto the bottom of the List.Listadd(java.lang.String text)Adds a newListItemto the bottom of the List.AccessibilityPropertiesgetAccessibilityProperties()Gets theaccessibility properties.<T1> T1getDefaultProperty(int property)Gets the default property from this entity.java.lang.StringgetPostSymbolText()Gets the piece of text that is added after theListItemsymbol.java.lang.StringgetPreSymbolText()Gets the piece of text that is added before theListItemsymbol.java.lang.FloatgetSymbolIndent()Gets the indent offset of theListItemsymbols.protected IRenderermakeNewRenderer()Creates a new renderer instance.ListsetItemStartIndex(int start)Customizes the index of the first item in the list.ListsetListSymbol(Image image)Sets the list symbol to be used.ListsetListSymbol(Text text)Sets the list symbol to be used.ListsetListSymbol(ListNumberingType listNumberingType)Sets the list numbering type to be used.ListsetListSymbol(java.lang.String symbol)Sets the list symbol to be used.ListsetListSymbolAlignment(ListSymbolAlignment alignment)A specialized enum containing alignment properties for list symbols.voidsetPostSymbolText(java.lang.String postSymbolText)Sets a piece of text that should be added after theListItemsymbol.voidsetPreSymbolText(java.lang.String preSymbolText)Sets a piece of text that should be added before theListItemsymbol.ListsetSymbolIndent(float symbolIndent)Sets the indent offset of theListItemsymbols.-
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, getTransparentStrokeColor, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBaseDirection, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDashPattern, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeColor, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, 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 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_SYMBOLas 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:IPropertyContainerGets the default property from this entity.- Specified by:
getDefaultPropertyin interfaceIPropertyContainer- Overrides:
getDefaultPropertyin 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,
nullwill be returned
-
add
public List add(ListItem listItem)
Adds a newListItemto the bottom of the List.- Parameters:
listItem- a new list item- Returns:
- this list.
-
add
public List add(java.lang.String text)
Adds a newListItemto 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 itemswill 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 itemswill be shown with the same prefix.- Parameters:
text- theTextobject 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 itemswill be shown with the same prefix.- Parameters:
image- theImageobject 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. everyListItemwill have a unique prefix.- Parameters:
listNumberingType- theListNumberingTypethat will generate appropriate prefixes for theListItems.- Returns:
- this list.
-
setListSymbolAlignment
public List setListSymbolAlignment(ListSymbolAlignment alignment)
A specialized enum containing alignment properties for list symbols.ListSymbolAlignment.LEFTmeans that the items will be aligned as follows: 9. Item 9 10. Item 10Whereas
ListSymbolAlignment.RIGHTmeans 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 theListItemsymbols.- Returns:
- the indent offset as a
float.
-
setSymbolIndent
public List setSymbolIndent(float symbolIndent)
Sets the indent offset of theListItemsymbols.- Parameters:
symbolIndent- the new indent offset.- Returns:
- this list.
-
getPostSymbolText
public java.lang.String getPostSymbolText()
Gets the piece of text that is added after theListItemsymbol.- Returns:
- the post symbol text
-
setPostSymbolText
public void setPostSymbolText(java.lang.String postSymbolText)
Sets a piece of text that should be added after theListItemsymbol.- Parameters:
postSymbolText- the post symbol text
-
getPreSymbolText
public java.lang.String getPreSymbolText()
Gets the piece of text that is added before theListItemsymbol.- Returns:
- the pre symbol text
-
setPreSymbolText
public void setPreSymbolText(java.lang.String preSymbolText)
Sets a piece of text that should be added before theListItemsymbol.- Parameters:
preSymbolText- the pre symbol text
-
getAccessibilityProperties
public AccessibilityProperties getAccessibilityProperties()
Description copied from interface:IAccessibleElementGets 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:AbstractElementCreates a new renderer instance.- Specified by:
makeNewRendererin classAbstractElement<List>- Returns:
- new
IRenderer
-
-