Class: WorkspaceComment
Defined in: packages/blockly/core/comments/workspace_comment.ts:17
Extended by
Properties index
| Property | Description |
|---|---|
| id | The unique identifier for this comment. |
| location | The location of the comment in workspace coordinates. |
| disposed | Whether this comment has been disposed or not. |
| disposing | Whether this comment is being disposed or not. |
| workspace | The workspace to construct the comment in. |
Methods index
| Method | Description |
|---|---|
| setText | Sets the text of the comment. |
| getText | Returns the text of the comment. |
| setSize | Sets the comment's size in workspace units. |
| getSize | Returns the comment's size in workspace units. |
| setCollapsed | Sets whether the comment is collapsed or not. |
| isCollapsed | Returns whether the comment is collapsed or not. |
| setEditable | Sets whether the comment is editable or not. |
| isEditable | Returns whether the comment is editable or not, respecting whether the workspace is read-only. |
| isOwnEditable | Returns whether the comment is editable or not, only examining its own state and ignoring the state of the workspace. |
| setMovable | Sets whether the comment is movable or not. |
| isMovable | Returns whether the comment is movable or not, respecting whether the workspace is read-only. |
| isOwnMovable | Returns whether the comment is movable or not, only examining its own state and ignoring the state of the workspace. |
| setDeletable | Sets whether the comment is deletable or not. |
| isDeletable | Returns whether the comment is deletable 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. |
| moveTo | Moves the comment to the given location in workspace coordinates. |
| getRelativeToSurfaceXY | Returns the position of the comment in workspace coordinates. |
| dispose | Disposes of this comment. |
| isDisposed | Returns whether the comment has been disposed or not. |
| isDeadOrDying | Returns true if this comment view is currently being disposed or has already been disposed. |
Constructors
Constructor
new WorkspaceComment(workspace, id?): WorkspaceComment;
Defined in: packages/blockly/core/comments/workspace_comment.ts:55
Constructs the comment.
Parameters
| Parameter | Type | Description |
|---|---|---|
workspace | Workspace | The workspace to construct the comment in. |
id? | string | An optional ID to give to the comment. If not provided, one will be generated. |
Returns
WorkspaceComment
Properties
id
readonly id: string;
Defined in: packages/blockly/core/comments/workspace_comment.ts:19
The unique identifier for this comment.
location
protected location: Coordinate;
Defined in: packages/blockly/core/comments/workspace_comment.ts:40
The location of the comment in workspace coordinates.
disposed
protected disposed: boolean = false;
Defined in: packages/blockly/core/comments/workspace_comment.ts:43
Whether this comment has been disposed or not.
disposing
protected disposing: boolean = false;
Defined in: packages/blockly/core/comments/workspace_comment.ts:46
Whether this comment is being disposed or not.
workspace
readonly workspace: Workspace;
Defined in: packages/blockly/core/comments/workspace_comment.ts:56
The workspace to construct the comment in.
Methods
setText()
setText(text): void;
Defined in: packages/blockly/core/comments/workspace_comment.ts:98
Sets the text of the comment.
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
void
getText()
getText(): string;
Defined in: packages/blockly/core/comments/workspace_comment.ts:105
Returns the text of the comment.
Returns
string
setSize()
setSize(size): void;
Defined in: packages/blockly/core/comments/workspace_comment.ts:110
Sets the comment's size in workspace units.
Parameters
| Parameter | Type |
|---|---|
size | Size |
Returns
void
getSize()
getSize(): Size;
Defined in: packages/blockly/core/comments/workspace_comment.ts:122
Returns the comment's size in workspace units.
Returns
setCollapsed()
setCollapsed(collapsed): void;
Defined in: packages/blockly/core/comments/workspace_comment.ts:127
Sets whether the comment is collapsed or not.
Parameters
| Parameter | Type |
|---|---|
collapsed | boolean |
Returns
void
isCollapsed()
isCollapsed(): boolean;
Defined in: packages/blockly/core/comments/workspace_comment.ts:133
Returns whether the comment is collapsed or not.
Returns
boolean
setEditable()
setEditable(editable): void;
Defined in: packages/blockly/core/comments/workspace_comment.ts:138
Sets whether the comment is editable or not.
Parameters
| Parameter | Type |
|---|---|
editable | boolean |
Returns
void
isEditable()
isEditable(): boolean;
Defined in: packages/blockly/core/comments/workspace_comment.ts:146
Returns whether the comment is editable or not, respecting whether the workspace is read-only.
Returns
boolean
isOwnEditable()
isOwnEditable(): boolean;
Defined in: packages/blockly/core/comments/workspace_comment.ts:154
Returns whether the comment is editable or not, only examining its own state and ignoring the state of the workspace.
Returns
boolean
setMovable()
setMovable(movable): void;
Defined in: packages/blockly/core/comments/workspace_comment.ts:159
Sets whether the comment is movable or not.
Parameters
| Parameter | Type |
|---|---|
movable | boolean |
Returns
void
isMovable()
isMovable(): boolean;
Defined in: packages/blockly/core/comments/workspace_comment.ts:167
Returns whether the comment is movable or not, respecting whether the workspace is read-only.
Returns
boolean
isOwnMovable()
isOwnMovable(): boolean;
Defined in: packages/blockly/core/comments/workspace_comment.ts:179
Returns whether the comment is movable or not, only examining its own state and ignoring the state of the workspace.
Returns
boolean
setDeletable()
setDeletable(deletable): void;
Defined in: packages/blockly/core/comments/workspace_comment.ts:184
Sets whether the comment is deletable or not.
Parameters
| Parameter | Type |
|---|---|
deletable | boolean |
Returns
void
isDeletable()
isDeletable(): boolean;
Defined in: packages/blockly/core/comments/workspace_comment.ts:192
Returns whether the comment is deletable or not, respecting whether the workspace is read-only.
Returns
boolean
isOwnDeletable()
isOwnDeletable(): boolean;
Defined in: packages/blockly/core/comments/workspace_comment.ts:205
Returns whether the comment is deletable or not, only examining its own state and ignoring the state of the workspace.
Returns
boolean
moveTo()
moveTo(location, reason?): void;
Defined in: packages/blockly/core/comments/workspace_comment.ts:210
Moves the comment to the given location in workspace coordinates.
Parameters
| Parameter | Type |
|---|---|
location | Coordinate |
reason? | string[] |
Returns
void
getRelativeToSurfaceXY()
getRelativeToSurfaceXY(): Coordinate;
Defined in: packages/blockly/core/comments/workspace_comment.ts:223
Returns the position of the comment in workspace coordinates.
Returns
dispose()
dispose(): void;
Defined in: packages/blockly/core/comments/workspace_comment.ts:228
Disposes of this comment.
Returns
void
isDisposed()
isDisposed(): boolean;
Defined in: packages/blockly/core/comments/workspace_comment.ts:236
Returns whether the comment has been disposed or not.
Returns
boolean
isDeadOrDying()
isDeadOrDying(): boolean;
Defined in: packages/blockly/core/comments/workspace_comment.ts:244
Returns true if this comment view is currently being disposed or has already been disposed.
Returns
boolean