Stay organized with collections
Save and categorize content based on your preferences.
blockly > FieldLabel
FieldLabel class
Class for a non-editable, non-serializable text field.
Signature:
export declare class FieldLabel extends Field<string>
Extends: Field<string>
Constructors
Properties
Property |
Modifiers |
Type |
Description |
EDITABLE |
|
boolean |
Editable fields usually show some sort of UI indicating they are editable. This field should not. |
maxDisplayLength |
|
number |
Text labels should not truncate. |
Methods
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003e\u003ccode\u003eFieldLabel\u003c/code\u003e is a Blockly class representing a non-editable, non-serializable text field used for labels within blocks.\u003c/p\u003e\n"],["\u003cp\u003eIt inherits from the \u003ccode\u003eField\u003c/code\u003e class and provides properties like \u003ccode\u003eEDITABLE\u003c/code\u003e (set to false) and \u003ccode\u003emaxDisplayLength\u003c/code\u003e to control its behavior.\u003c/p\u003e\n"],["\u003cp\u003eKey methods include \u003ccode\u003einitView\u003c/code\u003e for creating the UI, \u003ccode\u003esetClass\u003c/code\u003e for styling, and others for validation and configuration.\u003c/p\u003e\n"],["\u003cp\u003eThe primary purpose of \u003ccode\u003eFieldLabel\u003c/code\u003e is to display static text within a block, providing context or information to the user.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [FieldLabel](./blockly.fieldlabel_class.md)\n\nFieldLabel class\n----------------\n\nClass for a non-editable, non-serializable text field.\n\n**Signature:** \n\n export declare class FieldLabel extends Field\u003cstring\u003e \n\n**Extends:** [Field](./blockly.field_class.md)\\\u003cstring\\\u003e\n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|------------------------------------------------------------------------------------------------------|-----------|-----------------------------------------------------|\n| [(constructor)(value, textClass, config)](./blockly.fieldlabel_class._constructor__1_constructor.md) | | Constructs a new instance of the `FieldLabel` class |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|-----------------------------------------------------------------------------|-----------|---------|---------------------------------------------------------------------------------------------------|\n| [EDITABLE](./blockly.fieldlabel_class.editable_property.md) | | boolean | Editable fields usually show some sort of UI indicating they are editable. This field should not. |\n| [maxDisplayLength](./blockly.fieldlabel_class.maxdisplaylength_property.md) | | number | Text labels should not truncate. |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|-------------------------------------------------------------------------------------------|-------------|--------------------------------------------------------|\n| [configure_(config)](./blockly.fieldlabel_class.configure__1_method.md) | `protected` | |\n| [doClassValidation_(newValue)](./blockly.fieldlabel_class.doclassvalidation__1_method.md) | `protected` | Ensure that the input value casts to a valid string. |\n| [initView()](./blockly.fieldlabel_class.initview_1_method.md) | | Create block UI for this label. |\n| [setClass(cssClass)](./blockly.fieldlabel_class.setclass_1_method.md) | | Set the CSS class applied to the field's textElement_. |"]]