Customizing fields
Stay organized with collections
Save and categorize content based on your preferences.
While Blockly provides many useful fields, your application may have a
specialized case. Here are a few steps to take when customizing fields:
Read the documentation of any fields similar to what you require; they may
provide a useful interface for customization. For example,
dropdowns have a lot of hidden functionality.
Consider using a validator to solve your problem.
Validators allow you to only accept certain values, modify input, or trigger
functionality when a field's value changes.
Consider extending a field.
If there is a field that represents the value type you require, but you want to
modify its editor, its
appearance, or the
text it
displays, you can create a subclass
that inherits the bulk of the functionality, while overriding the specific parts
you want to change.
Create a new field type.
While this is the most powerful option, it is also the most time consuming, and
should generally only be used if you need to store a new value type.
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 2022-03-24 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]