Blockly.Events. CommentBase
Abstract class for a comment event.
Constructor
CommentBase
new CommentBase(opt_comment)
Parameter |
|
---|---|
opt_comment |
Optional The comment this event corresponds to. Undefined for a blank event. Value must not be null. |
- Extends
- Blockly.Events.Abstract
Properties
commentId
string
The ID of the comment this event pertains to.
group
string
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.
isBlank
boolean
Whether or not an event is blank.
isUiEvent
unknown
Whether or not the event is a UI event.
- Inherited from
- Blockly.Events.Abstract#isUiEvent
recordUndo
boolean
Sets whether the event should be added to the undo stack.
type
unknown
Type of this event.
- Inherited from
- Blockly.Events.Abstract#type
workspaceId
string
The workspace identifier for this event.
Methods
CommentCreateDeleteHelper
CommentCreateDeleteHelper(event, create)
Helper function for Comment[Create|Delete]
Parameter |
|
---|---|
event |
(non-null Blockly.Events.CommentCreate or non-null Blockly.Events.CommentDelete) The event to run. |
create |
boolean if True then Create, if False then Delete |
fromJson
fromJson(json)
Decode the JSON event.
Parameter |
|
---|---|
json |
Object JSON representation. Value must not be null. |
getEventWorkspace_
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?
- Inherited from
- Blockly.Events.Abstract#isNull
- Returns
-
True if null, false if something changed.
run
run(_forward)
Run an event.
Parameter |
|
---|---|
_forward |
True if run forward, false if run backward (undo). |
- Inherited from
- Blockly.Events.Abstract#run
toJson
toJson() returns Object
Encode the event as JSON.
- Returns
-
non-null Object
JSON representation.