Class TextFormatElement Stay organized with collections Save and categorize content based on your preferences.
A text format element, which can be aText,Styled,Hyperlink, orList.
Only available for Google Workspace add-ons that extend Google Workspace Studio.
Sample usage:
constsampleChip=AddOnsResponseService.newTextFormatChip().setLabel("Label!");consttextFormatElement=AddOnsResponseService.newTextFormatElement().setTextFormatChip(sampleChip);
Methods
| Method | Return type | Brief description |
|---|---|---|
set | Text | Sets the text format element as aHyperlink. |
set | Text | Sets the text format element as aList. |
set | Text | Sets the text format element as aStyled. |
set | Text | Sets the text format element as a text string. |
set | Text | Sets the text format element as aText. |
Detailed documentation
setHyperlink(hyperlink)
Sets the text format element as aHyperlink.
Parameters
| Name | Type | Description |
|---|---|---|
hyperlink | Hyperlink | TheHyperlink of the text format element. |
Return
Text — This text format element object.
setListContainer(listContainer)
Sets the text format element as aList.
Parameters
| Name | Type | Description |
|---|---|---|
list | List | TheList of the text format element. |
Return
Text — This text format element object.
setStyledText(styledText)
Sets the text format element as aStyled.
Parameters
| Name | Type | Description |
|---|---|---|
styled | Styled | TheStyled of the text format element. |
Return
Text — This text format element object.
setText(text)
Sets the text format element as a text string.
Parameters
| Name | Type | Description |
|---|---|---|
text | String | The text of the text format element. |
Return
Text — This text format element object.
setTextFormatChip(chip)
Sets the text format element as aText.
Parameters
| Name | Type | Description |
|---|---|---|
chip | Text | TheText of the text format element. |
Return
Text — This text format element object.
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-03 UTC.