Stay organized with collections
Save and categorize content based on your preferences.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003egetRootWorkspace()\u003c/code\u003e method retrieves the top-level workspace in a hierarchy of nested workspaces.\u003c/p\u003e\n"],["\u003cp\u003eWorkspaces embedded within structures like flyouts or bubbles have parent workspaces, and this method helps access the ultimate parent.\u003c/p\u003e\n"],["\u003cp\u003eIf the current workspace has no parent, meaning it's already the root, the method returns the current workspace itself.\u003c/p\u003e\n"],["\u003cp\u003eThe return value is either a \u003ccode\u003eWorkspace\u003c/code\u003e object representing the root or \u003ccode\u003enull\u003c/code\u003e if no root is found (though this is unlikely in typical scenarios).\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [Workspace](./blockly.workspace_class.md) \\\u003e [getRootWorkspace](./blockly.workspace_class.getrootworkspace_1_method.md)\n\nWorkspace.getRootWorkspace() method\n-----------------------------------\n\nReturns the root workspace of this workspace if the workspace has parent(s).\n\nE.g. workspaces in flyouts and mini workspace bubbles have parent workspaces.\n\n**Signature:** \n\n getRootWorkspace(): Workspace | null;\n\n**Returns:**\n\n[Workspace](./blockly.workspace_class.md) \\| null"]]