blockly > Workspace > getRootWorkspace
Workspace.getRootWorkspace() method
Returns the root workspace of this workspace if the workspace has parent(s).
E.g. workspaces in flyouts and mini workspace bubbles have parent workspaces.
Signature:
getRootWorkspace(): Workspace | null;
Returns:
Workspace | null
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 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `getRootWorkspace()` method retrieves the top-level workspace in a hierarchy of nested workspaces."],["Workspaces embedded within structures like flyouts or bubbles have parent workspaces, and this method helps access the ultimate parent."],["If the current workspace has no parent, meaning it's already the root, the method returns the current workspace itself."],["The return value is either a `Workspace` object representing the root or `null` if no root is found (though this is unlikely in typical scenarios)."]]],[]]