blockly > comments > WorkspaceComment

comments.WorkspaceComment class

Signature:

export declare class WorkspaceComment 

Constructors

Constructor Modifiers Description
(constructor)(workspace, id) Constructs the comment.

Properties

Property Modifiers Type Description
disposed protected boolean Whether this comment has been disposed or not.
disposing protected boolean Whether this comment is being disposed or not.
id readonly string The unique identifier for this comment.
location protected Coordinate The location of the comment in workspace coordinates.
workspace readonly Workspace

Methods

Method Modifiers Description
dispose() Disposes of this comment.
getRelativeToSurfaceXY() Returns the position of the comment in workspace coordinates.
getSize() Returns the comment's size in workspace units.
getText() Returns the text of the comment.
isCollapsed() Returns whether the comment is collapsed or not.
isDeadOrDying() Returns true if this comment view is currently being disposed or has already been disposed.
isDeletable() Returns whether the comment is deletable or not, respecting whether the workspace is read-only.
isDisposed() Returns whether the comment has been disposed or not.
isEditable() Returns whether the comment is editable or not, respecting whether the workspace is read-only.
isMovable() Returns whether the comment is movable or not, respecting whether the workspace is read-only.
isOwnDeletable() Returns whether the comment is deletable or not, only examining its own state and ignoring the state of the workspace.
isOwnEditable() Returns whether the comment is editable or not, only examining its own state and ignoring the state of the workspace.
isOwnMovable() Returns whether the comment is movable or not, only examining its own state and ignoring the state of the workspace.
moveTo(location, reason) Moves the comment to the given location in workspace coordinates.
setCollapsed(collapsed) Sets whether the comment is collapsed or not.
setDeletable(deletable) Sets whether the comment is deletable or not.
setEditable(editable) Sets whether the comment is editable or not.
setMovable(movable) Sets whether the comment is movable or not.
setSize(size) Sets the comment's size in workspace units.
setText(text) Sets the text of the comment.