Class: DeleteCommentBarButton
Defined in: packages/blockly/core/comments/delete_comment_bar_button.ts:25
Button that deletes a comment.
Extends
Properties index
| Property | Description |
|---|---|
| id | The ID of this button's parent comment. |
| workspace | The workspace this button's parent comment is on. |
| container | An SVG group that this button should be a child of. |
| commentView | - |
| icon | SVG image displayed on this button. |
Methods index
| Method | Description |
|---|---|
| isVisible | Returns whether or not this button is currently visible. |
| getCommentView | Returns the parent comment view of this comment bar button. |
| getSize | Returns the dimensions of this button in workspace coordinates. |
| getMargin | Returns the margin in workspace coordinates surrounding this button. |
| getFocusableElement | Returns a DOM element representing this button that can receive focus. |
| getFocusableTree | Returns the workspace this button is a child of. |
| onNodeFocus | Called when this button's focusable DOM element gains focus. |
| onNodeBlur | Called when this button's focusable DOM element loses focus. |
| canBeFocused | Returns whether this button can be focused. True if it is visible. |
| recomputeAriaContext | Recomputes the ARIA label and role for this button. Note that this is not automatically called during initialization and must be called once a button's focusable element (icon) is initialized. Implementations may also find it useful to call this if the button's label should be changed. |
| dispose | Disposes of this button. |
| reposition | Adjusts the positioning of this button within its container. |
| performAction | Deletes parent comment. |
| getAriaLabel | Returns the ARIA label to use for this button (defaults to null). Note that this method will only be called and apply when recomputeAriaContext is called. |
Constructors
Constructor
new DeleteCommentBarButton(
id,
workspace,
container,
commentView
): DeleteCommentBarButton;
Defined in: packages/blockly/core/comments/delete_comment_bar_button.ts:43
Creates a new DeleteCommentBarButton instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The ID of this button's parent comment. |
workspace | WorkspaceSvg | The workspace this button's parent comment is shown on. |
container | SVGGElement | An SVG group that this button should be a child of. |
commentView | CommentView | - |
Returns
DeleteCommentBarButton
Overrides
Properties
id
readonly id: string;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:31
The ID of this button's parent comment.
Inherited from
workspace
protected readonly workspace: WorkspaceSvg;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:32
The workspace this button's parent comment is on.
Inherited from
container
protected readonly container: SVGGElement;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:33
An SVG group that this button should be a child of.
Inherited from
commentView
protected readonly commentView: CommentView;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:34
Inherited from
icon
protected readonly icon: SVGImageElement;
Defined in: packages/blockly/core/comments/delete_comment_bar_button.ts:34
SVG image displayed on this button.
Overrides
Methods
isVisible()
isVisible(): boolean;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:40
Returns whether or not this button is currently visible.
Returns
boolean
Inherited from
getCommentView()
getCommentView(): CommentView;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:47
Returns the parent comment view of this comment bar button.
Returns
Inherited from
CommentBarButton.getCommentView
getSize()
getSize(includeMargin?): Rect;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:63
Returns the dimensions of this button in workspace coordinates.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
includeMargin | boolean | false | True to include the margin when calculating the size. |
Returns
The size of this button.
Inherited from
getMargin()
getMargin(): number;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:77
Returns the margin in workspace coordinates surrounding this button.
Returns
number
Inherited from
getFocusableElement()
getFocusableElement(): SVGImageElement;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:82
Returns a DOM element representing this button that can receive focus.
Returns
SVGImageElement
Inherited from
CommentBarButton.getFocusableElement
getFocusableTree()
getFocusableTree(): WorkspaceSvg;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:87
Returns the workspace this button is a child of.
Returns
Inherited from
CommentBarButton.getFocusableTree
onNodeFocus()
onNodeFocus(): void;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:92
Called when this button's focusable DOM element gains focus.
Returns
void
Inherited from
onNodeBlur()
onNodeBlur(): void;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:101
Called when this button's focusable DOM element loses focus.
Returns
void
Inherited from
canBeFocused()
canBeFocused(): boolean;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:104
Returns whether this button can be focused. True if it is visible.
Returns
boolean
Inherited from
recomputeAriaContext()
protected recomputeAriaContext(): void;
Defined in: packages/blockly/core/comments/comment_bar_button.ts:114
Recomputes the ARIA label and role for this button. Note that this is not automatically called during initialization and must be called once a button's focusable element (icon) is initialized. Implementations may also find it useful to call this if the button's label should be changed.
Returns
void
Inherited from
CommentBarButton.recomputeAriaContext
dispose()
dispose(): void;
Defined in: packages/blockly/core/comments/delete_comment_bar_button.ts:77
Disposes of this button.
Returns
void
reposition()
reposition(): void;
Defined in: packages/blockly/core/comments/delete_comment_bar_button.ts:84
Adjusts the positioning of this button within its container.
Returns
void
Overrides
performAction()
performAction(e?): void;
Defined in: packages/blockly/core/comments/delete_comment_bar_button.ts:102
Deletes parent comment.
Parameters
| Parameter | Type | Description |
|---|---|---|
e? | Event | The event that triggered this action. |
Returns
void
Overrides
CommentBarButton.performAction
getAriaLabel()
protected getAriaLabel(): string;
Defined in: packages/blockly/core/comments/delete_comment_bar_button.ts:121
Returns the ARIA label to use for this button (defaults to null). Note that this method will only be called and apply when recomputeAriaContext is called.
Returns
string
The ARIA label to use for this button, or null to use a default.