Class: BlockBase
Defined in: packages/blockly/core/events/events_block_base.ts:24
Abstract class for any event related to blocks.
Extends
Extended by
Properties index
| Property | Description |
|---|---|
| workspaceId | The workspace identifier for this event. |
| group | An ID for the group of events this block is associated with. |
| recordUndo | Whether this event is undoable or not. |
| isUiEvent | Whether or not the event is a UI event. |
| type | Type of this event. |
| isBlank | Whether or not the event was constructed without necessary parameters (to be populated by fromJson). |
| blockId | The ID of the block associated with this event. |
Methods index
| Method | Description |
|---|---|
| isNull | Does this event record any change of state? |
| run | Run an event. |
| getEventWorkspace_ | Get workspace the event belongs to. |
| toJson | Encode the event as JSON. |
Constructors
Constructor
new BlockBase(opt_block?): BlockBase;
Defined in: packages/blockly/core/events/events_block_base.ts:34
Parameters
| Parameter | Type | Description |
|---|---|---|
opt_block? | Block | The block this event corresponds to. Undefined for a blank event. |
Returns
BlockBase
Overrides
Properties
workspaceId?
optional workspaceId?: string = undefined;
Defined in: packages/blockly/core/events/events_abstract.ts:30
The workspace identifier for this event.
Inherited from
group
group: string;
Defined in: packages/blockly/core/events/events_abstract.ts:38
An ID for the group of events this block is associated with.
Groups define events that should be treated as an single action from the user's perspective, and should be undone together.
Inherited from
recordUndo
recordUndo: boolean;
Defined in: packages/blockly/core/events/events_abstract.ts:41
Whether this event is undoable or not.
Inherited from
isUiEvent
isUiEvent: boolean = false;
Defined in: packages/blockly/core/events/events_abstract.ts:44
Whether or not the event is a UI event.
Inherited from
type
type: string = '';
Defined in: packages/blockly/core/events/events_abstract.ts:47
Type of this event.
Inherited from
isBlank
isBlank: boolean = true;
Defined in: packages/blockly/core/events/events_block_base.ts:25
Whether or not the event was constructed without necessary parameters (to be populated by fromJson).
Overrides
blockId?
optional blockId?: string;
Defined in: packages/blockly/core/events/events_block_base.ts:28
The ID of the block associated with this event.
Methods
isNull()
isNull(): boolean;
Defined in: packages/blockly/core/events/events_abstract.ts:91
Does this event record any change of state?
Returns
boolean
True if null, false if something changed.
Inherited from
run()
run(_forward): void;
Defined in: packages/blockly/core/events/events_abstract.ts:100
Run an event.
Parameters
| Parameter | Type | Description |
|---|---|---|
_forward | boolean | True if run forward, false if run backward (undo). |
Returns
void
Inherited from
getEventWorkspace_()
getEventWorkspace_(): Workspace;
Defined in: packages/blockly/core/events/events_abstract.ts:111
Get workspace the event belongs to.
Returns
The workspace the event belongs to.
Throws
if workspace is null.
Inherited from
toJson()
toJson(): BlockBaseJson;
Defined in: packages/blockly/core/events/events_block_base.ts:49
Encode the event as JSON.
Returns
JSON representation.