Blockly.Events. Abstract
Constructor
Abstract
new Abstract()
Abstract class for an event.
Properties
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
nullable boolean
Whether or not the event is blank (to be populated by fromJson).
isUiEvent
boolean
Whether or not the event is a ui event.
recordUndo
boolean
Sets whether the event should be added to the undo stack.
workspaceId
(string or undefined)
The workspace identifier for this event.
Methods
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.
- Throws
-
Error
if workspace is null. - Returns
-
non-null Blockly.Workspace
The workspace the event belongs to.
isNull
isNull() returns boolean
Does this event record any change of state?
- Returns
-
boolean
True if null, false if something changed.
run
run(_forward)
Run an 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.