Stay organized with collections
Save and categorize content based on your preferences.
blockly > comments > CommentBarButton
Button displayed on a comment's top bar.
Signature:
export declare abstract class CommentBarButton implements IFocusableNode
Implements: IFocusableNode
Constructors
Properties
Property |
Modifiers |
Type |
Description |
container |
protected
readonly
|
SVGGElement |
|
icon |
protected
abstract
readonly
|
SVGImageElement |
SVG image displayed on this button. |
id |
protected
readonly
|
string |
|
workspace |
protected
readonly
|
WorkspaceSvg |
|
Methods
Method |
Modifiers |
Description |
canBeFocused() |
|
Returns whether this button can be focused. True if it is visible. |
getFocusableElement() |
|
Returns a DOM element representing this button that can receive focus. |
getFocusableTree() |
|
Returns the workspace this button is a child of. |
getMargin() |
|
Returns the margin in workspace coordinates surrounding this button. |
getParentComment() |
|
Returns the parent comment of this comment bar button. |
getSize(includeMargin) |
|
Returns the dimensions of this button in workspace coordinates. |
isVisible() |
|
Returns whether or not this button is currently visible. |
onNodeBlur() |
|
Called when this button's focusable DOM element loses focus. |
onNodeFocus() |
|
Called when this button's focusable DOM element gains focus. |
performAction(e) |
abstract |
Perform the action this button should take when it is acted on. |
reposition() |
abstract |
Adjusts the position of this button within its parent container. |
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 2025-07-24 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 2025-07-24 UTC."],[],[],null,["[blockly](./blockly.md) \\\u003e [comments](./blockly.comments_namespace.md) \\\u003e [CommentBarButton](./blockly.comments_namespace.commentbarbutton_class.md)\n\ncomments.CommentBarButton class\n-------------------------------\n\nButton displayed on a comment's top bar.\n\n**Signature:** \n\n export declare abstract class CommentBarButton implements IFocusableNode \n\n**Implements:** [IFocusableNode](./blockly.ifocusablenode_interface.md)\n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|-------------------------------------------------------------------------------------------------------------------------------|-----------|------------------------------------------|\n| [(constructor)(id, workspace, container)](./blockly.comments_namespace.commentbarbutton_class._constructor__1_constructor.md) | | Creates a new CommentBarButton instance. |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|----------------------------------------------------------------------------------------|-----------------------------------|-------------------------------------------------|-------------------------------------|\n| [container](./blockly.comments_namespace.commentbarbutton_class.container_property.md) | `protected` `readonly` | SVGGElement | |\n| [icon](./blockly.comments_namespace.commentbarbutton_class.icon_property.md) | `protected` `abstract` `readonly` | SVGImageElement | SVG image displayed on this button. |\n| [id](./blockly.comments_namespace.commentbarbutton_class.id_property.md) | `protected` `readonly` | string | |\n| [workspace](./blockly.comments_namespace.commentbarbutton_class.workspace_property.md) | `protected` `readonly` | [WorkspaceSvg](./blockly.workspacesvg_class.md) | |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|--------------------------------------------------------------------------------------------------------------|------------|------------------------------------------------------------------------|\n| [canBeFocused()](./blockly.comments_namespace.commentbarbutton_class.canbefocused_1_method.md) | | Returns whether this button can be focused. True if it is visible. |\n| [getFocusableElement()](./blockly.comments_namespace.commentbarbutton_class.getfocusableelement_1_method.md) | | Returns a DOM element representing this button that can receive focus. |\n| [getFocusableTree()](./blockly.comments_namespace.commentbarbutton_class.getfocusabletree_1_method.md) | | Returns the workspace this button is a child of. |\n| [getMargin()](./blockly.comments_namespace.commentbarbutton_class.getmargin_1_method.md) | | Returns the margin in workspace coordinates surrounding this button. |\n| [getParentComment()](./blockly.comments_namespace.commentbarbutton_class.getparentcomment_1_method.md) | | Returns the parent comment of this comment bar button. |\n| [getSize(includeMargin)](./blockly.comments_namespace.commentbarbutton_class.getsize_1_method.md) | | Returns the dimensions of this button in workspace coordinates. |\n| [isVisible()](./blockly.comments_namespace.commentbarbutton_class.isvisible_1_method.md) | | Returns whether or not this button is currently visible. |\n| [onNodeBlur()](./blockly.comments_namespace.commentbarbutton_class.onnodeblur_1_method.md) | | Called when this button's focusable DOM element loses focus. |\n| [onNodeFocus()](./blockly.comments_namespace.commentbarbutton_class.onnodefocus_1_method.md) | | Called when this button's focusable DOM element gains focus. |\n| [performAction(e)](./blockly.comments_namespace.commentbarbutton_class.performaction_1_method.md) | `abstract` | Perform the action this button should take when it is acted on. |\n| [reposition()](./blockly.comments_namespace.commentbarbutton_class.reposition_1_method.md) | `abstract` | Adjusts the position of this button within its parent container. |"]]