Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > Zablokuj > setWarningText
Metoda Block.setWarningText()
Ustaw tekst ostrzeżenia dla tego bloku.
Podpis:
setWarningText(_text: string | null, _opt_id?: string): void;
Parametry
| Parametr |
Typ |
Opis |
| tekst |
ciąg znaków | wartość null |
Tekst lub wartość null do usunięcia. |
| _opt_id |
ciąg znaków |
(Opcjonalnie) Opcjonalny identyfikator tekstu ostrzeżenia, który pozwala wyświetlać wiele ostrzeżeń. |
Zwroty:
nieważne
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-25 UTC."],[],["The `Block.setWarningText()` method sets a block's warning text. It accepts two parameters: `_text`, which is the warning text (or `null` to delete it), and an optional `_opt_id` for managing multiple warnings. The method returns void. Its primary action is to either set or remove a specific warning message associated with a block, allowing for potentially multiple distinct warning texts.\n"]]