blockly > comments > CommentBarButton

comments.CommentBarButton 类

显示在评论顶部栏中的按钮。

Signature:

export declare abstract class CommentBarButton implements IFocusableNode 

实现IFocusableNode

构造函数

构造函数 修饰符 说明
(constructor)(id, workspace, container) 创建新的 CommentBarButton 实例。

属性

属性 修饰符 类型 说明
容器

protected

readonly

SVGGElement
图标

protected

abstract

readonly

SVGImageElement 此按钮上显示的 SVG 图像。
id

protected

readonly

字符串
工作区

protected

readonly

WorkspaceSvg

方法

方法 修饰符 说明
canBeFocused() 返回相应按钮是否可聚焦。如果可见,则为 True。
getFocusableElement() 返回一个表示此按钮且可接收焦点的 DOM 元素。
getFocusableTree() 返回相应按钮所属的工作区。
getMargin() 返回此按钮周围的边距(以工作区坐标表示)。
getParentComment() 返回相应评论栏按钮所对应的父评论。
getSize(includeMargin) 返回此按钮在工作区坐标中的尺寸。
isVisible() 返回相应按钮当前是否处于可见状态。
onNodeBlur() 当此按钮的可聚焦 DOM 元素失去焦点时调用。
onNodeFocus() 当此按钮的可聚焦 DOM 元素获得焦点时调用。
performAction(e) abstract 在按钮被操作时执行该按钮应执行的操作。
reposition() abstract 调整此按钮在其父容器中的位置。