blockly > Field > getText_
Field.getText_() method
A developer hook to override the returned text of this field. Override if the text representation of the value of this field is not just a string cast of its value. Return null to resort to a string cast.
Signature:
protected getText_(): string | null;
Returns:
string | null
Current text or null.
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 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["`Field.getText_()` is a method intended for developers to customize the text representation of a field's value."],["This method allows overriding the default string representation of a field's value, providing flexibility in displaying field content."],["If the text representation is simply a string version of the field's value, there is no need to override this method."],["Returning `null` from this method will cause the field to fall back to the default behavior of casting the value to a string."]]],[]]