Skip to main content

Class: DeleteCommentBarButton

Defined in: packages/blockly/core/comments/delete_comment_bar_button.ts:25

Button that deletes a comment.

Extends

Properties index

PropertyDescription
idThe ID of this button's parent comment.
workspaceThe workspace this button's parent comment is on.
containerAn SVG group that this button should be a child of.
commentView-
iconSVG image displayed on this button.

Methods index

MethodDescription
isVisibleReturns whether or not this button is currently visible.
getCommentViewReturns the parent comment view of this comment bar button.
getSizeReturns the dimensions of this button in workspace coordinates.
getMarginReturns the margin in workspace coordinates surrounding this button.
getFocusableElementReturns a DOM element representing this button that can receive focus.
getFocusableTreeReturns the workspace this button is a child of.
onNodeFocusCalled when this button's focusable DOM element gains focus.
onNodeBlurCalled when this button's focusable DOM element loses focus.
canBeFocusedReturns whether this button can be focused. True if it is visible.
recomputeAriaContextRecomputes 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.
disposeDisposes of this button.
repositionAdjusts the positioning of this button within its container.
performActionDeletes parent comment.
getAriaLabelReturns 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

ParameterTypeDescription
idstringThe ID of this button's parent comment.
workspaceWorkspaceSvgThe workspace this button's parent comment is shown on.
containerSVGGElementAn SVG group that this button should be a child of.
commentViewCommentView-

Returns

DeleteCommentBarButton

Overrides

CommentBarButton.constructor

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

CommentBarButton.id


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

CommentBarButton.workspace


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

CommentBarButton.container


commentView

protected readonly commentView: CommentView;

Defined in: packages/blockly/core/comments/comment_bar_button.ts:34

Inherited from

CommentBarButton.commentView


icon

protected readonly icon: SVGImageElement;

Defined in: packages/blockly/core/comments/delete_comment_bar_button.ts:34

SVG image displayed on this button.

Overrides

CommentBarButton.icon

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

CommentBarButton.isVisible


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

CommentView

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

ParameterTypeDefault valueDescription
includeMarginbooleanfalseTrue to include the margin when calculating the size.

Returns

Rect

The size of this button.

Inherited from

CommentBarButton.getSize


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

CommentBarButton.getMargin


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

WorkspaceSvg

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

CommentBarButton.onNodeFocus


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

CommentBarButton.onNodeBlur


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

CommentBarButton.canBeFocused


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

CommentBarButton.reposition


performAction()

performAction(e?): void;

Defined in: packages/blockly/core/comments/delete_comment_bar_button.ts:102

Deletes parent comment.

Parameters

ParameterTypeDescription
e?EventThe 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.

Overrides

CommentBarButton.getAriaLabel