blockly > comments > WorkspaceComment
Signature:
export declare class WorkspaceComment
Constructors
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. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `WorkspaceComment` class represents comments that can be added to a Blockly workspace."],["It provides methods to manage the comment's properties such as text, size, location, and visibility."],["Comments can be collapsed, moved, edited, and deleted, with control over their individual editability and movability."],["This class interacts with the `Workspace` to manage its position and lifecycle."],["The comment's state can be queried to determine if it is disposed, deletable, editable, or movable."]]],[]]