Skip to main content

Class: BlockFieldIntermediateChange

Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:27

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​

PropertyDescription
workspaceIdThe workspace identifier for this event.
groupAn ID for the group of events this block is associated with.
isUiEventWhether or not the event is a UI event.
isBlankWhether or not the event was constructed without necessary parameters (to be populated by fromJson).
blockIdThe ID of the block associated with this event.
typeType of this event.
recordUndoWhether this event is undoable or not.
nameThe name of the field that changed.
oldValueThe original value of the element.
newValueThe new value of the element.

Methods index​

MethodDescription
getEventWorkspace_Get workspace the event belongs to.
toJsonEncode the event as JSON.
isNullDoes this event record any change of state?
runRun 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:57

Parameters​

ParameterTypeDescription
opt_block?BlockThe changed block. Undefined for a blank event.
opt_name?stringName of the field affected.
opt_oldValue?unknownPrevious value of element.
opt_newValue?unknownNew value of element.

Returns​

BlockFieldIntermediateChange

Overrides​

BlockBase.constructor

Properties​

workspaceId?​

optional workspaceId?: string = undefined;

Defined in: packages/blockly/core/events/events_abstract.ts:30

The workspace identifier for this event.

Inherited from​

BlockBase.workspaceId


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​

BlockBase.group


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​

BlockBase.isUiEvent


isBlank​

isBlank: boolean = true;

Defined in: packages/blockly/core/events/events_block_base.ts:23

Whether or not the event was constructed without necessary parameters (to be populated by fromJson).

Inherited from​

BlockBase.isBlank


blockId?​

optional blockId?: string;

Defined in: packages/blockly/core/events/events_block_base.ts:26

The ID of the block associated with this event.

Inherited from​

BlockBase.blockId


type​

type: EventType = EventType.BLOCK_FIELD_INTERMEDIATE_CHANGE;

Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:28

Type of this event.

Overrides​

BlockBase.type


recordUndo​

recordUndo: boolean = false;

Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:40

Whether this event is undoable or not.

Overrides​

BlockBase.recordUndo


name?​

optional name?: string;

Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:43

The name of the field that changed.


oldValue​

oldValue: unknown;

Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:46

The original value of the element.


newValue​

newValue: unknown;

Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:49

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​

Workspace

The workspace the event belongs to.

Throws​

if workspace is null.

Inherited from​

BlockBase.getEventWorkspace_


toJson()​

toJson(): BlockFieldIntermediateChangeJson;

Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:78

Encode the event as JSON.

Returns​

BlockFieldIntermediateChangeJson

JSON representation.

Overrides​

BlockBase.toJson


isNull()​

isNull(): boolean;

Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:122

Does this event record any change of state?

Returns​

boolean

False if something changed.

Overrides​

BlockBase.isNull


run()​

run(forward): void;

Defined in: packages/blockly/core/events/events_block_field_intermediate_change.ts:131

Run a change event.

Parameters​

ParameterTypeDescription
forwardbooleanTrue if run forward, false if run backward (undo).

Returns​

void

Overrides​

BlockBase.run