Stay organized with collections
Save and categorize content based on your preferences.
blockly > IToolbox
Interface for a toolbox.
Signature:
export interface IToolbox extends IRegistrable, IFocusableTree
Extends: IRegistrable, IFocusableTree
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.
[[["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 2025-05-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eIToolbox\u003c/code\u003e interface defines the structure and behavior of a toolbox in Blockly, extending the \u003ccode\u003eIRegistrable\u003c/code\u003e interface.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods for managing toolbox items, handling selection, positioning, and rendering the toolbox content.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003eclearSelection\u003c/code\u003e, \u003ccode\u003egetSelectedItem\u003c/code\u003e, and \u003ccode\u003erefreshSelection\u003c/code\u003e manage toolbox item selection.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIToolbox\u003c/code\u003e interface facilitates toolbox initialization, disposal, and interaction with the workspace.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use \u003ccode\u003eIToolbox\u003c/code\u003e methods to control the toolbox's appearance, including visibility, position, and theme.\u003c/p\u003e\n"]]],["The IToolbox interface defines methods for managing a toolbox. Key actions include initializing, disposing, and positioning the toolbox. It allows getting and setting properties like height, width, visibility, and selected items. The interface facilitates rendering toolbox items, handling resizes, and refreshing content. It also manages flyout, theme, and selection states, and supports both horizontal and vertical orientations. The toolbox is tied to a workspace, retrievable via the interface.\n"],null,["[blockly](./blockly.md) \\\u003e [IToolbox](./blockly.itoolbox_interface.md)\n\nIToolbox interface\n------------------\n\nInterface for a toolbox.\n\n**Signature:** \n\n export interface IToolbox extends IRegistrable, IFocusableTree \n\n**Extends:** [IRegistrable](./blockly.iregistrable_interface.md), [IFocusableTree](./blockly.ifocusabletree_interface.md)\n\nMethods\n-------\n\n| Method | Description |\n|----------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [clearSelection()](./blockly.itoolbox_interface.clearselection_1_methodsignature.md) | Unhighlights any previously selected item. |\n| [dispose()](./blockly.itoolbox_interface.dispose_1_methodsignature.md) | Disposes of this toolbox. |\n| [getFlyout()](./blockly.itoolbox_interface.getflyout_1_methodsignature.md) | Gets the toolbox flyout. |\n| [getHeight()](./blockly.itoolbox_interface.getheight_1_methodsignature.md) | Gets the height of the toolbox. |\n| [getSelectedItem()](./blockly.itoolbox_interface.getselecteditem_1_methodsignature.md) | Gets the selected item. |\n| [getWidth()](./blockly.itoolbox_interface.getwidth_1_methodsignature.md) | Gets the width of the toolbox. |\n| [getWorkspace()](./blockly.itoolbox_interface.getworkspace_1_methodsignature.md) | Gets the workspace for the toolbox. |\n| [handleToolboxItemResize()](./blockly.itoolbox_interface.handletoolboxitemresize_1_methodsignature.md) | Handles resizing the toolbox when a toolbox item resizes. |\n| [init()](./blockly.itoolbox_interface.init_1_methodsignature.md) | Initializes the toolbox. |\n| [isHorizontal()](./blockly.itoolbox_interface.ishorizontal_1_methodsignature.md) | Gets whether or not the toolbox is horizontal. |\n| [position()](./blockly.itoolbox_interface.position_1_methodsignature.md) | Positions the toolbox based on whether it is a horizontal toolbox and whether the workspace is in rtl. |\n| [refreshSelection()](./blockly.itoolbox_interface.refreshselection_1_methodsignature.md) | Updates the flyout's content without closing it. Should be used in response to a change in one of the dynamic categories, such as variables or procedures. |\n| [refreshTheme()](./blockly.itoolbox_interface.refreshtheme_1_methodsignature.md) | Updates the category colours and background colour of selected categories. |\n| [render(toolboxDef)](./blockly.itoolbox_interface.render_1_methodsignature.md) | Fills the toolbox with new toolbox items and removes any old contents. |\n| [selectItemByPosition(position)](./blockly.itoolbox_interface.selectitembyposition_1_methodsignature.md) | Selects the toolbox item by its position in the list of toolbox items. |\n| [setSelectedItem(item)](./blockly.itoolbox_interface.setselecteditem_1_methodsignature.md) | Sets the selected item. |\n| [setVisible(isVisible)](./blockly.itoolbox_interface.setvisible_1_methodsignature.md) | Sets the visibility of the toolbox. |"]]