Class TextParagraph
テキスト段落
テキストを表示し、基本的な HTML 形式をサポートするウィジェット。
Google Workspace アドオンと Google Chat アプリで利用できます。
const textParagraph = CardService.newTextParagraph().setText(
'This is a text paragraph widget. Multiple lines are allowed if needed.',
);
詳細なドキュメント
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);
パラメータ
名前 | 型 | 説明 |
maxLines | Integer | 表示されるテキストの最大行数。 |
戻る
TextParagraph
- チェーン用のこのオブジェクト。
setText(text)
段落のテキストを設定します。必須。
パラメータ
名前 | 型 | 説明 |
text | String | 表示するテキスト。 |
戻る
TextParagraph
- チェーン用のこのオブジェクト。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-01-30 UTC。
[null,null,["最終更新日 2025-01-30 UTC。"],[[["The `TextParagraph` widget displays text with basic HTML formatting support."],["It is usable in Google Workspace Add-ons and Google Chat apps."],["Developers can set the displayed text using the `setText()` method and can chain additional methods for further customization."],["The `setText()` method requires a string argument representing the desired text content."]]],["The `TextParagraph` widget displays text with basic HTML formatting in Google Workspace add-ons and Google Chat apps. Key actions include `setText(text)` to define the displayed text and `setMaxLines(maxLines)` to limit the visible lines; exceeding this limit adds a \"show more\" button. `setMaxLines` is in developer preview for Google Workspace and available for Google Chat, whereas `setText` is fully available. Both methods return the `TextParagraph` object to enable method chaining.\n"]]