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
From class com.pdftron.layout.ContentElement
From class java.lang.Object

Public Methods

public ListItem addItem ()

Add a new list item to the list.

Returns
  • The ListItem object representing the newly added item.

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.

public int getIndentationLevel ()

Get the indentation level of the list.

Returns
  • The indentation level.

public TextStyledElement getLabelStyle ()

Get the text style element for the list item labels.

Returns
  • The TextStyledElement representing the label style.

public int getListIdentifier ()

Get the identifier of the list.

Returns
  • The list identifier.

public void setNumberFormat (List.ListItemNumberFormat format)

Set the number format of the list.

Parameters
format The number format to set for the list.

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.

public void setStartIndex (int idx)

Set the start index for the list items.

Parameters
idx The start index value.