Summary: Nested Classes | Methods | Inherited Methods | [Expand All]
public class

# List

extends ContentNode

java.lang.Object
↳ | com.pdftron.layout.ContentElement
| ↳ | com.pdftron.layout.ContentNode
|  | ↳ | com.pdftron.layout.List

## Class Overview

A class representing a list in the document content tree.

## Summary

Nested Classes
enum | List.ListItemNumberFormat |

Public Methods
ListItem | addItem() Add a new list item to the list.
void | continueList() Continues the logical continuation of a particular list, even if other non-list content items have been created since the last call to AddItem().
int | getIndentationLevel() Get the indentation level of the list.
TextStyledElement | getLabelStyle() Get the text style element for the list item labels.
int | getListIdentifier() Get the identifier of the list.
void | setNumberFormat(List.ListItemNumberFormat format) Set the number format of the list.
void | setNumberFormat(List.ListItemNumberFormat format, String suffix, boolean cascade) Set the number format of the list with a custom suffix and cascade flag.
void | setStartIndex(int idx) Set the start index for the list items.

[Expand] Inherited Methods
From class com.pdftron.layout.ContentNode
ContentNodeIterator | getContentNodeIterator() Retrieve a ContentNodeIterator object from the content node The ContentNodeIterator object can be used to traverse the children of the content node.
From class com.pdftron.layout.ContentElement
ContentNode | asContentNode() Retrieve the `ContentNode` object for this content element if it is a content node.
List | asList() Retrieve the `List` object for this content element if it is a list.
ListItem | asListItem() Retrieve the `ListItem` object for this content element if it is a list item.
Paragraph | asParagraph() Retrieve the `Paragraph` object for this content element if it is a paragraph.
Table | asTable() Retrieve the `Table` object for this content element if it is a table.
TableCell | asTableCell() Retrieve the `TableCell` object for this content element if it is a table cell.
TableRow | asTableRow() Retrieve the `TableRow` object for this content element if it is a table row.
TextRun | asTextRun() Retrieve the `TextRun` object for this content element if it is a text run.
TextStyledElement | getTextStyledElement() Retrieve the `TextStyledElement` object for manipulating the text style of this content element.
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Methods

#### public ListItem addItem ()

Add a new list item to the list.

##### Returns

- The ListItem object representing the newly added item.

##### Throws

PDFNetException |

#### public void continueList ()

Continues the logical continuation of a particular list, even if other non-list content items have been created since the last call to AddItem(). This method is useful when splitting a sublist and wanting to continue the new items as part of the original sublist hierarchy. Note: Without calling ContinueList(), new list items created after a split (e.g., a split paragraph) would be added to the main list structure (above the split) based on their natural positions in the list/sublist hierarchy. Example usage: To continue a root-level list after a split, call ContinueList() on the root-level list.

##### Throws

PDFNetException |

#### public int getIndentationLevel ()

Get the indentation level of the list.

##### Returns

- The indentation level.

##### Throws

PDFNetException |

#### public TextStyledElement getLabelStyle ()

Get the text style element for the list item labels.

##### Returns

- The TextStyledElement representing the label style.

##### Throws

PDFNetException |

#### public int getListIdentifier ()

Get the identifier of the list.

##### Returns

- The list identifier.

##### Throws

PDFNetException |

#### public void setNumberFormat (List.ListItemNumberFormat format)

Set the number format of the list.

##### Parameters

format | The number format to set for the list.

##### Throws

PDFNetException |

#### public void setNumberFormat (List.ListItemNumberFormat format, String suffix, boolean cascade)

Set the number format of the list with a custom suffix and cascade flag.

##### Parameters

format | The number format to set for the list.
suffix | The suffix to append to the list item number.
cascade | If true, the number format will be applied to nested lists as well.

##### Throws

PDFNetException |

#### public void setStartIndex (int idx)

Set the start index for the list items.

##### Parameters

idx | The start index value.

##### Throws

PDFNetException |