調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
フィールドのカスタマイズ
Blockly には有用なフィールドが多数用意されていますが、アプリケーションには特殊なケースがある場合があります。フィールドをカスタマイズする場合の手順は次のとおりです。
必要なフィールドと同様のフィールドのドキュメントをご覧ください。カスタマイズに役立つインターフェースが用意されています。たとえば、プルダウンには多くの非表示機能があります。
検証ツールを使用して、問題を解決することを検討してください。バリデータを使用すると、特定の値のみを受け入れ、入力の変更や、フィールドの値の変更時に機能をトリガーできます。
フィールドを拡張することを検討してください。必要な値の型を表すフィールドがあり、そのエディタ、外観、またはテキストを変更する場合は、機能の大部分を継承しながら、変更する特定の部分をオーバーライドするサブクラスを作成できます。
新しいフィールド タイプを作成します。これは最も強力なオプションですが、最も時間がかかるうえ、通常は新しい値タイプを保存する必要がある場合にのみ使用してください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2022-12-06 UTC。
[null,null,["最終更新日 2022-12-06 UTC。"],[[["Blockly offers customization options beyond its built-in fields, allowing developers to tailor fields to their specific needs."],["Before creating a new field type, explore existing fields, validators, and extension capabilities for potential solutions."],["Leverage validators to control accepted values, modify input, or trigger actions based on field value changes."],["Extend existing fields to modify their editor, appearance, or displayed text while inheriting core functionality."],["Creating a new field type is the most powerful but time-intensive option, reserved for storing new value types."]]],["Customizing Blockly fields involves several steps: First, review documentation of similar fields for potential customization options. Second, use validators to control accepted values, modify input, or trigger actions upon value changes. Third, extend existing fields by creating subclasses to modify their editor, appearance, or displayed text. Finally, create a new field type for storing novel value types, though this is the most complex option.\n"]]