blockly > comments > CommentView
comments.CommentView class
Signature:
export declare class CommentView implements IRenderedElement
Implements: IRenderedElement
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(workspace) | Constructs a new instance of the CommentView class |
Methods
Method | Modifiers | Description |
---|---|---|
addDisposeListener(listener) | Registers a callback that listens for disposal of this view. | |
addOnCollapseListener(listener) | Registers a callback that listens for collapsed-ness changes. | |
addSizeChangeListener(listener) | Registers a callback that listens for size changes. | |
addTextChangeListener(listener) | Registers a callback that listens for text changes. | |
dispose() | Disposes of this comment view. | |
getRelativeToSurfaceXY() | Returns the current location of the comment in workspace coordinates. | |
getSize() | Returns the current size of the comment in workspace units. Respects collapsing. | |
getSvgRoot() | Returns the root SVG group element of the comment view. | |
getText() | Retursn the current text of the comment. | |
isCollapsed() | Returns true if the comment is currently collapsed. | |
isDeadOrDying() | Returns true if this comment view is currently being disposed or has already been disposed. | |
isDisposed() | Returns whether this comment view has been disposed or not. | |
isEditable() | Returns true if the comment is currently editable. | |
moveTo(location) | Moves the comment view to the given location. | |
removeDisposeListener(listener) | Removes the given listener from the list of disposal listeners. | |
removeOnCollapseListener(listener) | Removes the given listener from the list of on collapse listeners. | |
removeSizeChangeListener(listener) | Removes the given listener from the list of size change listeners. | |
removeTextChangeListener(listener) | Removes the given listener from the list of text change listeners. | |
setCollapsed(collapsed) | Sets whether the comment is currently collapsed or not. | |
setEditable(editable) | Sets the editability of the comment. | |
setSize(size) | Sets the size of the comment in workspace units, and updates the view elements to reflect the new size. | |
setText(text) | Sets the current text of the comment. |