Skip to main content

Class: BackpackChange

Defined in: plugins/workspace-backpack/src/ui_events.ts:92

A UI event representing a change in a backpack's contents.

Extends​

  • UiBase

Properties index​

PropertyDescription
groupAn ID for the group of events this block is associated with.
isBlankWhether or not the event was constructed without necessary parameters (to be populated by fromJson).
isUiEventWhether or not the event is a UI event.
recordUndoWhether this event is undoable or not.
typeType of this event.
workspaceIdThe workspace identifier for this event.

Methods index​

MethodDescription
getEventWorkspace_Get workspace the event belongs to.
isNullDoes this event record any change of state?
runRun an event.
toJsonEncode the event as JSON.

Constructors​

Constructor​

new BackpackChange(opt_workspaceId?): BackpackChange;

Parameters​

ParameterTypeDescription
opt_workspaceId?stringThe workspace identifier for this event. Undefined for a blank event.

Returns​

BackpackChange

Inherited from​

Blockly.Events.UiBase.constructor

Properties​

group​

group: string;

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​

Blockly.Events.UiBase.group


isBlank​

isBlank: boolean;

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

Inherited from​

Blockly.Events.UiBase.isBlank


isUiEvent​

isUiEvent: boolean;

Whether or not the event is a UI event.

Inherited from​

Blockly.Events.UiBase.isUiEvent


recordUndo​

recordUndo: boolean;

Whether this event is undoable or not.

Inherited from​

Blockly.Events.UiBase.recordUndo


type​

type: string = backpackChange;

Defined in: plugins/workspace-backpack/src/ui_events.ts:96

Type of this event.

Overrides​

Blockly.Events.UiBase.type


workspaceId​

workspaceId: string;

The workspace identifier for this event.

Inherited from​

Blockly.Events.UiBase.workspaceId

Methods​

getEventWorkspace_()​

getEventWorkspace_(): Workspace;

Get workspace the event belongs to.

Returns​

Workspace

The workspace the event belongs to.

Throws​

if workspace is null.

Inherited from​

Blockly.Events.UiBase.getEventWorkspace_


isNull()​

isNull(): boolean;

Does this event record any change of state?

Returns​

boolean

True if null, false if something changed.

Inherited from​

Blockly.Events.UiBase.isNull


run()​

run(_forward): void;

Run an event.

Parameters​

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

Returns​

void

Inherited from​

Blockly.Events.UiBase.run


toJson()​

toJson(): AbstractEventJson;

Encode the event as JSON.

Returns​

AbstractEventJson

JSON representation.

Inherited from​

Blockly.Events.UiBase.toJson