Class ListStyle | Apps Script | Google for Developers (original) (raw)
Class ListStyle
Stay organized with collections Save and categorize content based on your preferences.
ListStyle
The list styling for a range of text.
Methods
Method | Return type | Brief description |
---|---|---|
applyListPreset(listPreset) | ListStyle | Applies the specified ListPreset to all of the paragraphs that overlap with the text. |
getGlyph() | String | Returns the rendered glyph for the text. |
getList() | List | Returns the List the text is in, or null if none of the text is in a list, or part of the text is in a list, or the text is in multiple lists. |
getNestingLevel() | Integer | Returns the 0-based nesting level of the text. |
isInList() | Boolean | Returns true if the text is in exactly one list, false if none of the text is in a list, and null if only some of the text is in a list or if the text is in multiple lists. |
removeFromList() | ListStyle | Removes the paragraphs that overlap with the text from any lists. |
Detailed documentation
applyListPreset(listPreset)
Applies the specified [ListPreset](/apps-script/reference/slides/list-preset)
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 each paragraph. To avoid excess space between the glyphs and the corresponding paragraph, these leading tabs are removed by this method.
If the paragraph immediately before paragraphs being updated is in a [List](/apps-script/reference/slides/list)
with a matching list preset and the paragraphs being updated are not already in a different list, the paragraphs being updated are added to that preceding list.
Parameters
Name | Type | Description |
---|---|---|
listPreset | ListPreset |
Return
[ListStyle](#)
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/presentations.currentonly
https://www.googleapis.com/auth/presentations
getGlyph()
Returns the rendered glyph for the text. Returns null
if the text spans more than one paragraph or the text is not in a list.
Return
String
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/presentations.currentonly
https://www.googleapis.com/auth/presentations
getList()
Returns the [List](/apps-script/reference/slides/list)
the text is in, or null
if none of the text is in a list, or part of the text is in a list, or the text is in multiple lists. Call [isInList()](#isInList%28%29)
to determine whether the text is in a list.
Return
[List](/apps-script/reference/slides/list)
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/presentations.currentonly
https://www.googleapis.com/auth/presentations
getNestingLevel()
Returns the 0-based nesting level of the text. Returns null
if the text is not in a list or there are mixed values.
Return
Integer
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/presentations.currentonly
https://www.googleapis.com/auth/presentations
isInList()
Returns true
if the text is in exactly one list, false
if none of the text is in a list, and null
if only some of the text is in a list or if the text is in multiple lists.
Return
Boolean
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
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 of the corresponding paragraph.
Return
[ListStyle](#)
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
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 the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-02 UTC.