Stay organized with collections
Save and categorize content based on your preferences.
blockly > Events > CommentBase
Abstract class for a comment event.
Signature:
export declare class CommentBase extends AbstractEvent
Extends: AbstractEvent
Constructors
Properties
Property |
Modifiers |
Type |
Description |
commentId? |
|
string |
(Optional) The ID of the comment that this event references. |
isBlank |
|
boolean |
|
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\u003eThe \u003ccode\u003eCommentBase\u003c/code\u003e class in Blockly is an abstract class used as a foundation for comment-related events.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003ecommentId\u003c/code\u003e to identify the comment and \u003ccode\u003eisBlank\u003c/code\u003e to indicate its state.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCommentBase\u003c/code\u003e provides methods such as \u003ccode\u003eCommentCreateDeleteHelper\u003c/code\u003e to assist with comment creation or deletion events, extending the functionality of the \u003ccode\u003eAbstractEvent\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can encode a \u003ccode\u003eCommentBase\u003c/code\u003e event as JSON using the \u003ccode\u003etoJson()\u003c/code\u003e method for data transmission or storage.\u003c/p\u003e\n"]]],["The `CommentBase` class, extending `AbstractEvent`, serves as a foundation for comment-related events. It features a constructor for creating instances, an optional `commentId` property to identify the comment, and a `isBlank` property. The class provides a static helper method, `CommentCreateDeleteHelper`, for managing comment creation/deletion events. It also includes a `toJson` method for converting events into JSON format.\n"],null,["[blockly](./blockly.md) \\\u003e [Events](./blockly.events_namespace.md) \\\u003e [CommentBase](./blockly.events_namespace.commentbase_class.md)\n\nEvents.CommentBase class\n\nAbstract class for a comment event.\n\n**Signature:** \n\n export declare class CommentBase extends AbstractEvent \n\n**Extends:** [AbstractEvent](./blockly.events_namespace.abstract_class.md)\n\nConstructors\n\n| Constructor | Modifiers | Description |\n|-----------------------------------------------------------------------------------------------------------|-----------|------------------------------------------------------|\n| [(constructor)(opt_comment)](./blockly.events_namespace.commentbase_class._constructor__1_constructor.md) | | Constructs a new instance of the `CommentBase` class |\n\nProperties\n\n| Property | Modifiers | Type | Description |\n|----------------------------------------------------------------------------------|-----------|---------|----------------------------------------------------------------|\n| [commentId?](./blockly.events_namespace.commentbase_class.commentid_property.md) | | string | *(Optional)* The ID of the comment that this event references. |\n| [isBlank](./blockly.events_namespace.commentbase_class.isblank_property.md) | | boolean | |\n\nMethods\n\n| Method | Modifiers | Description |\n|--------------------------------------------------------------------------------------------------------------------------------|-----------|-----------------------------------------------|\n| [CommentCreateDeleteHelper(event, create)](./blockly.events_namespace.commentbase_class.commentcreatedeletehelper_1_method.md) | `static` | Helper function for Comment\\[Create\\|Delete\\] |\n| [toJson()](./blockly.events_namespace.commentbase_class.tojson_1_method.md) | | Encode the event as JSON. |"]]