blockly > comments > CommentBarButton
comments.CommentBarButton 類別
顯示在留言頂端列的按鈕。
Signature:
export declare abstract class CommentBarButton implements IFocusableNode
實作: IFocusableNode
建構函式
| 建構函式 | 修飾符 | 說明 |
|---|---|---|
| (constructor)(id, workspace, container) | 建立新的 CommentBarButton 執行個體。 |
屬性
| 屬性 | 修飾符 | 類型 | 說明 |
|---|---|---|---|
| 容器 |
|
SVGGElement | |
| 圖示 |
|
SVGImageElement | 這個按鈕上顯示的 SVG 圖片。 |
| id |
|
字串 | |
| workspace |
|
WorkspaceSvg |
方法
| 方法 | 修飾符 | 說明 |
|---|---|---|
| canBeFocused() | 傳回這個按鈕是否可聚焦。如果可見,則為 True。 | |
| getFocusableElement() | 傳回代表這個按鈕的 DOM 元素,可接收焦點。 | |
| getFocusableTree() | 傳回這個按鈕所屬的工作區。 | |
| getMargin() | 傳回這個按鈕周圍的邊界,以工作區座標表示。 | |
| getParentComment() | 傳回這個留言列按鈕的父項留言。 | |
| getSize(includeMargin) | 以工作區座標傳回這個按鈕的維度。 | |
| isVisible() | 傳回這個按鈕目前是否顯示。 | |
| onNodeBlur() | 當這個按鈕的可聚焦 DOM 元素失去焦點時呼叫。 | |
| onNodeFocus() | 當這個按鈕的可聚焦 DOM 元素獲得焦點時呼叫。 | |
| performAction(e) | abstract |
執行按鈕在執行動作時應採取的動作。 |
| reposition() | abstract |
調整這個按鈕在上層容器中的位置。 |