blockly > comments > CommentEditor

comments.CommentEditor 類別

可輸入文字的註解部分。

Signature:

export declare class CommentEditor implements IFocusableNode 

實作: IFocusableNode

建構函式

建構函式 修飾符 說明
(constructor)(workspace, commentId, onFinishEditing) 建構 CommentEditor 類別的新例項

屬性

屬性 修飾符 類型 說明
ID? 字串 (選用)
workspace WorkspaceSvg

方法

方法 修飾符 說明
addTextChangeListener(listener) 註冊會監聽文字變更的回呼。
canBeFocused()
getDom() 取得這個註解編輯器的 DOM 結構。
getFocusableElement()
getFocusableTree()
getText() 取得註解的目前文字。
onNodeBlur()
onNodeFocus()
removeTextChangeListener(listener) 從文字變更事件監聽器清單中移除指定的監聽器。
setEditable(isEditable) 設定文字區域是否可編輯。否則文字區域會設為唯讀。
setPlaceholderText(text) 設定空白留言顯示的預留位置文字。
setText(text) 設定留言的目前文字,並觸發變更事件監聽器。
updateSize(size, topBarSize) 更新留言編輯器元素的大小。