Class TextFormatElement

TextFormatElement

A text format element, which can be a TextFormatChip , StyledText , Hyperlink , or ListContainer .

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

MethodReturn typeBrief description
setHyperlink(hyperlink) TextFormatElement Sets the text format element as a Hyperlink .
setListContainer(listContainer) TextFormatElement Sets the text format element as a ListContainer .
setStyledText(styledText) TextFormatElement Sets the text format element as a StyledText .
setText(text) TextFormatElement Sets the text format element as a text string.
setTextFormatChip(chip) TextFormatElement Sets the text format element as a TextFormatChip .

Detailed documentation

Sets the text format element as a Hyperlink .

Parameters

NameTypeDescription
hyperlinkHyperlink The Hyperlink of the text format element.

Return

TextFormatElement — This text format element object.


setListContainer(listContainer)

Sets the text format element as a ListContainer .

Parameters

NameTypeDescription
listContainerListContainer The ListContainer of the text format element.

Return

TextFormatElement — This text format element object.


setStyledText(styledText)

Sets the text format element as a StyledText .

Parameters

NameTypeDescription
styledTextStyledText The StyledText of the text format element.

Return

TextFormatElement — This text format element object.


setText(text)

Sets the text format element as a text string.

Parameters

NameTypeDescription
textStringThe text of the text format element.

Return

TextFormatElement — This text format element object.


setTextFormatChip(chip)

Sets the text format element as a TextFormatChip .

Parameters

NameTypeDescription
chipTextFormatChip The TextFormatChip of the text format element.

Return

TextFormatElement — This text format element object.

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 2025年12月03日 UTC.