Class TextParagraph

テキスト段落

テキストを表示し、基本的な HTML 形式をサポートするウィジェット。

Google Workspace アドオンと Google Chat アプリで利用できます。

const textParagraph = CardService.newTextParagraph().setText(
    'This is a text paragraph widget. Multiple lines are allowed if needed.',
);

メソッド

メソッド戻り値の型概要
addEventAction(eventAction)Widgetウィジェットで実行できるイベント アクションを追加します。
setId(id)Widget変更するウィジェットの識別に使用される一意の ID を設定します。
setMaxLines(maxLines)TextParagraphウィジェットに表示されるテキストの最大行数を設定します。
setText(text)TextParagraph段落のテキストを設定します。
setVisibility(visibility)Widgetウィジェットの可視性を設定します。

詳細なドキュメント

addEventAction(eventAction)

ウィジェットで実行できるイベント アクションを追加します。

パラメータ

名前説明
eventActionEventAction追加する EventAction

戻る

Widget - チェーン用の Object。


setId(id)

変更するウィジェットの識別に使用される一意の ID を設定します。ウィジェットの変更はアドオンでのみサポートされています。

パラメータ

名前説明
idStringウィジェットの ID。64 文字以内で、`[a-zA-Z0-9-]+` の形式で指定します。

戻る

Widget - チェーン用のこのオブジェクト。


setMaxLines(maxLines)

ウィジェットに表示されるテキストの最大行数を設定します。テキストが指定された最大行数を超えると、超過したコンテンツは [詳細を表示] ボタンの背後に隠されます。テキストが指定された最大行数以下の場合、[もっと見る] ボタンは表示されません。

Google Chat アプリで利用できます。Google Workspace アドオンのデベロッパー プレビュー版です。

const textParagraph =
    CardService.newTextParagraph()
        .setText(
            'This is a text paragraph widget. Multiple lines are allowed if needed.',
            )
        .setMaxLines(1);

パラメータ

名前説明
maxLinesInteger表示されるテキストの最大行数。

戻る

TextParagraph - チェーン用のこのオブジェクト。


setText(text)

段落のテキストを設定します。必須。

パラメータ

名前説明
textString表示するテキスト。

戻る

TextParagraph - チェーン用のこのオブジェクト。


setVisibility(visibility)

ウィジェットの可視性を設定します。デフォルト値は `VISIBLE` です。

パラメータ

名前説明
visibilityVisibilityウィジェットの Visibility

戻る

Widget - チェーン用の Object。