Class: BackpackOpen
Defined in: plugins/workspace-backpack/src/ui_events.ts:22
A UI event representing a backpack opening or closing.
Extends
UiBase
Properties index
| Property | Description |
|---|---|
| group | An ID for the group of events this block is associated with. |
| isBlank | Whether or not the event was constructed without necessary parameters (to be populated by fromJson). |
| isOpen | Whether the backpack flyout is opening (false if closing). Undefined for a blank event. |
| isUiEvent | Whether or not the event is a UI event. |
| recordUndo | Whether this event is undoable or not. |
| type | Type of this event. |
| workspaceId | The workspace identifier for this event. |
Methods index
| Method | Description |
|---|---|
| getEventWorkspace_ | Get workspace the event belongs to. |
| isNull | Does this event record any change of state? |
| run | Run an event. |
| toJson | Encode the event as JSON. |
| fromJson | Decode the JSON event. |
Constructors
Constructor
new BackpackOpen(isOpen?, workspaceId?): BackpackOpen;
Defined in: plugins/workspace-backpack/src/ui_events.ts:36
Class for a backpack open event.
Parameters
| Parameter | Type | Description |
|---|---|---|
isOpen? | boolean | Whether the backpack flyout is opening (false if closing). Undefined for a blank event. |
workspaceId? | string | The workspace identifier for this event. Undefined for a blank event. |
Returns
BackpackOpen
Overrides
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
isOpen?
isOpen?: boolean;
Defined in: plugins/workspace-backpack/src/ui_events.ts:37
Whether the backpack flyout is opening (false if closing). Undefined for a blank event.
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 = backpackOpen;
Defined in: plugins/workspace-backpack/src/ui_events.ts:26
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
| Parameter | Type | Description |
|---|---|---|
_forward | boolean | True if run forward, false if run backward (undo). |
Returns
void
Inherited from
Blockly.Events.UiBase.run
toJson()
toJson(): BackpackOpenEventJson;
Defined in: plugins/workspace-backpack/src/ui_events.ts:48
Encode the event as JSON.
Returns
JSON representation.
Overrides
Blockly.Events.UiBase.toJson
fromJson()
static fromJson(
json,
workspace,
event
): BackpackOpen;
Defined in: plugins/workspace-backpack/src/ui_events.ts:62
Decode the JSON event.
Parameters
| Parameter | Type | Description |
|---|---|---|
json | BackpackOpenEventJson | JSON representation. |
workspace | Workspace | A workspace to create the event on. |
event | unknown | an instance of BackpackOpen to deserialize into. |
Returns
BackpackOpen
A newly deserialized BackpackOpen event.
Overrides
Blockly.Events.UiBase.fromJson