Class: BlockFieldIntermediateChange
Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:26
Notifies listeners when the value of a block's field has changed but the change is not yet complete, and is expected to be followed by a block change event.
Extends
Properties index
| Property | Description |
|---|---|
| workspaceId | The workspace identifier for this event. |
| group | An ID for the group of events this block is associated with. |
| isUiEvent | Whether or not the event is a UI 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. |
| type | Type of this event. |
| recordUndo | Whether this event is undoable or not. |
| name | The name of the field that changed. |
| oldValue | The original value of the element. |
| newValue | The new value of the element. |
Methods index
| Method | Description |
|---|---|
| getEventWorkspace_ | Get workspace the event belongs to. |
| toJson | Encode the event as JSON. |
| isNull | Does this event record any change of state? |
| run | Run a change event. |
Constructors
Constructor
new BlockFieldIntermediateChange(
opt_block?,
opt_name?,
opt_oldValue?,
opt_newValue?
): BlockFieldIntermediateChange;
Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:56
Parameters
| Parameter | Type | Description |
|---|---|---|
opt_block? | Block | The changed block. Undefined for a blank event. |
opt_name? | string | Name of the field affected. |
opt_oldValue? | unknown | Previous value of element. |
opt_newValue? | unknown | New value of element. |
Returns
BlockFieldIntermediateChange
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
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
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).
Inherited from
blockId?
optional blockId?: string;
Defined in: packages/blockly/core/events/events_block_base.ts:28
The ID of the block associated with this event.
Inherited from
type
type: EventType = EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE;
Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:27
Type of this event.
Overrides
recordUndo
recordUndo: boolean = false;
Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:39
Whether this event is undoable or not.
Overrides
name?
optional name?: string;
Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:42
The name of the field that changed.
oldValue
oldValue: unknown;
Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:45
The original value of the element.
newValue
newValue: unknown;
Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:48
The new value of the element.
Methods
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(): BlockFieldIntermediateChangeJson;
Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:77
Encode the event as JSON.
Returns
BlockFieldIntermediateChangeJson
JSON representation.
Overrides
isNull()
isNull(): boolean;
Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:121
Does this event record any change of state?
Returns
boolean
False if something changed.
Overrides
run()
run(forward): void;
Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:130
Run a change event.
Parameters
| Parameter | Type | Description |
|---|---|---|
forward | boolean | True if run forward, false if run backward (undo). |
Returns
void