blockly > comments > CommentEditor
comments.CommentEditor 类
评论中可输入的部分。
Signature:
export declare class CommentEditor implements IFocusableNode
实现: IFocusableNode
构造函数
构造函数 | 修饰符 | 说明 |
---|---|---|
(构造函数)(workspace, commentId, onFinishEditing) | 构造 CommentEditor 类的新实例 |
属性
属性 | 修饰符 | 类型 | 说明 |
---|---|---|---|
id? | 字符串 | (可选) | |
工作区 | WorkspaceSvg |
方法
方法 | 修饰符 | 说明 |
---|---|---|
addTextChangeListener(listener) | 注册一个监听文本更改的回调。 | |
canBeFocused() | ||
getDom() | 获取相应评论编辑器的 DOM 结构。 | |
getFocusableElement() | ||
getFocusableTree() | ||
getText() | 获取评论的当前文本。 | |
onNodeBlur() | ||
onNodeFocus() | ||
removeTextChangeListener(listener) | 从文本更改监听器列表中移除指定监听器。 | |
setEditable(isEditable) | 设置文本区是否可编辑。如果不是,则文本区将为只读。 | |
setPlaceholderText(text) | 设置针对空白评论显示的占位文本。 | |
setText(text) | 设置评论的当前文本并触发更改监听器。 | |
updateSize(size, topBarSize) | 更新了评论编辑器元素的大小。 |