Constructor

CommentChange

new CommentChange(comment, oldContents, newContents)

Class for a comment change event.

Parameter

comment

Blockly.WorkspaceComment

The comment that is being changed. Null for a blank event.

oldContents

string

Previous contents of the comment.

newContents

string

New contents of the comment.

Extends
Blockly.Events.CommentBase

Properties

commentId

unknown

The ID of the comment this event pertains to.

Inherited from
Blockly.Events.CommentBase#commentId

group

unknown

The event group id for the group this event belongs to. Groups define events that should be treated as an single action from the user's perspective, and should be undone together.

Inherited from
Blockly.Events.CommentBase#group

recordUndo

unknown

Sets whether the event should be added to the undo stack.

Inherited from
Blockly.Events.CommentBase#recordUndo

type

string

Type of this event.

workspaceId

unknown

The workspace identifier for this event.

Inherited from
Blockly.Events.CommentBase#workspaceId

Methods

fromJson

fromJson(json)

Decode the JSON event.

Parameter

json

Object

JSON representation.

Value must not be null.

getEventWorkspace_

protected

getEventWorkspace_() returns Blockly.Workspace

Get workspace the event belongs to.

Inherited from
Blockly.Events.Abstract#getEventWorkspace_
Throws

if workspace is null.

Returns

The workspace the event belongs to.

isNull

isNull() returns boolean

Does this event record any change of state?

Returns

boolean False if something changed.

run

run(forward)

Run a change event.

Parameter

forward

boolean

True if run forward, false if run backward (undo).

toJson

toJson() returns Object

Encode the event as JSON.

Returns

non-null Object JSON representation.