blockly > Events > Abstract
Events.Abstract class
Abstract class for an event.
Signature:
export declare abstract class Abstract
Constructors
Constructor |
Modifiers |
Description |
(constructor)() |
|
Constructs a new instance of the Abstract class |
Properties
Property |
Modifiers |
Type |
Description |
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. |
isBlank |
abstract |
boolean |
Whether or not the event was constructed without necessary parameters (to be populated by fromJson). |
isUiEvent |
|
boolean |
Whether or not the event is a UI event. |
recordUndo |
|
boolean |
Whether this event is undoable or not. |
type |
|
string |
Type of this event. |
workspaceId? |
|
string |
(Optional) The workspace identifier for this event. |
Methods
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-16 UTC.
[null,null,["Last updated 2025-05-16 UTC."],[[["`Events.Abstract` is a base class for all Blockly events, defining common properties and methods."],["It provides properties like `type`, `group`, `recordUndo`, and `isUiEvent` to describe event characteristics."],["Events can be serialized to JSON using `toJson()` and executed with `run()`."],["Subclasses implement specific event logic and data."],["`isBlank` property indicates if the event was created without full information, potentially to be filled by `fromJson()`."]]],["The `Events.Abstract` class serves as a base for event handling. Key properties include a `group` ID for related events, `isBlank` indicating incomplete construction, `isUiEvent` denoting UI-related events, and `recordUndo` determining if the event is undoable. Each event has a `type` and optionally a `workspaceId`. Core methods include `isNull()` to check for state change, `run()` to execute the event, and `toJson()` for JSON encoding.\n"]]