Class ListStyle

  • ListStyle represents the list styling for a range of text.

  • Methods are available to apply a list preset, get the glyph, retrieve the list the text belongs to, get the nesting level, check if the text is in a list, and remove the text from a list.

  • Applying a list preset applies the style to overlapping paragraphs, removing leading tabs and potentially adding the paragraphs to a preceding list if applicable.

  • Authorization with specific scopes is required for scripts using these ListStyle methods.

ListStyle

The list styling for a range of text.

Methods

MethodReturn typeBrief description
applyListPreset(listPreset)ListStyleApplies the specifiedListPreset to all of the paragraphs that overlap with the text.
getGlyph()String|nullReturns the rendered glyph for the text.
getList()List|nullReturns theList the text is in, ornull if none of the text is in a list, orpart of the text is in a list, or the text is in multiple lists.
getNestingLevel()Integer|nullReturns the 0-based nesting level of the text.
isInList()Boolean|nullReturnstrue if the text is in exactly one list,false if none of the text isin a list, andnull if only some of the text is in a list or if the text is in multiplelists.
removeFromList()ListStyleRemoves the paragraphs that overlap with the text from any lists.

Detailed documentation

applyListPreset(listPreset)

Applies the specifiedListPreset to all of the paragraphs that overlap with the text.

The nesting level of each paragraph is determined by counting leading tabs in front of eachparagraph. To avoid excess space between the glyphs and the corresponding paragraph, theseleading tabs are removed by this method.

If the paragraph immediately before paragraphs being updated is in aList with amatching list preset and the paragraphs being updated are not already in a different list, theparagraphs being updated are added to that preceding list.

Parameters

NameTypeDescription
listPresetListPreset

Return

ListStyle

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getGlyph()

Returns the rendered glyph for the text. Returnsnull if the text spans more than oneparagraph or the text is not in a list.

Return

String|null

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getList()

Returns theList the text is in, ornull if none of the text is in a list, orpart of the text is in a list, or the text is in multiple lists. CallisInList() todetermine whether the text is in a list.

Return

List|null

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getNestingLevel()

Returns the 0-based nesting level of the text. Returnsnull if the text is not in alist or there are mixed values.

Return

Integer|null

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

isInList()

Returnstrue if the text is in exactly one list,false if none of the text isin a list, andnull if only some of the text is in a list or if the text is in multiplelists.

Return

Boolean|null

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

removeFromList()

Removes the paragraphs that overlap with the text from any lists.

The nesting level of each paragraph is visually preserved by adding indent to the start ofthe corresponding paragraph.

Return

ListStyle

Authorization

Scripts that use this method require authorization with one or more of the followingscopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.