Stay organized with collections
Save and categorize content based on your preferences.
blockly > CollapsibleToolboxCategory
Class for a category in a toolbox that can be collapsed.
Signature:
export declare class CollapsibleToolboxCategory extends ToolboxCategory implements ICollapsibleToolboxItem
Extends: ToolboxCategory
Implements: ICollapsibleToolboxItem
Constructors
Properties
Property |
Modifiers |
Type |
Description |
expanded_ |
protected |
boolean |
Whether or not the category should display its subcategories. |
registrationName |
static |
string |
Name used for registering a collapsible toolbox category. |
subcategoriesDiv_ |
protected |
HTMLDivElement | null |
Container for any child categories. |
toolboxItems_ |
protected |
IToolboxItem[] |
The child toolbox items for this category. |
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 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\u003e\u003ccode\u003eCollapsibleToolboxCategory\u003c/code\u003e extends \u003ccode\u003eToolboxCategory\u003c/code\u003e and implements \u003ccode\u003eICollapsibleToolboxItem\u003c/code\u003e, representing a category within a toolbox that can be expanded or collapsed to reveal subcategories.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to manage its collapsed/expanded state, such as \u003ccode\u003esetExpanded\u003c/code\u003e, \u003ccode\u003eisExpanded\u003c/code\u003e, and \u003ccode\u003etoggleExpanded\u003c/code\u003e, influencing the visibility of child categories.\u003c/p\u003e\n"],["\u003cp\u003eThe class handles the creation and structure of the category's DOM elements, including those for subcategories, through methods like \u003ccode\u003ecreateDom_\u003c/code\u003e and \u003ccode\u003ecreateSubCategoriesDom_\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eProperties like \u003ccode\u003etoolboxItems_\u003c/code\u003e and \u003ccode\u003esubcategoriesDiv_\u003c/code\u003e store and manage the child elements and subcategory container, respectively, within the category.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eexpanded_\u003c/code\u003e property tracks the category's current expansion state, determining whether child subcategories are displayed or hidden.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [CollapsibleToolboxCategory](./blockly.collapsibletoolboxcategory_class.md)\n\nCollapsibleToolboxCategory class\n--------------------------------\n\nClass for a category in a toolbox that can be collapsed.\n\n**Signature:** \n\n export declare class CollapsibleToolboxCategory extends ToolboxCategory implements ICollapsibleToolboxItem \n\n**Extends:** [ToolboxCategory](./blockly.toolboxcategory_class.md)\n\n**Implements:** [ICollapsibleToolboxItem](./blockly.icollapsibletoolboxitem_interface.md)\n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|------------------------------------------------------------------------------------------------------------------------------|-----------|---------------------------------------------------------------------|\n| [(constructor)(categoryDef, toolbox, opt_parent)](./blockly.collapsibletoolboxcategory_class._constructor__1_constructor.md) | | Constructs a new instance of the `CollapsibleToolboxCategory` class |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|-----------------------------------------------------------------------------------------------|-------------|---------------------------------------------------------|---------------------------------------------------------------|\n| [expanded_](./blockly.collapsibletoolboxcategory_class.expanded__property.md) | `protected` | boolean | Whether or not the category should display its subcategories. |\n| [registrationName](./blockly.collapsibletoolboxcategory_class.registrationname_property.md) | `static` | string | Name used for registering a collapsible toolbox category. |\n| [subcategoriesDiv_](./blockly.collapsibletoolboxcategory_class.subcategoriesdiv__property.md) | `protected` | HTMLDivElement \\| null | Container for any child categories. |\n| [toolboxItems_](./blockly.collapsibletoolboxcategory_class.toolboxitems__property.md) | `protected` | [IToolboxItem](./blockly.itoolboxitem_interface.md)\\[\\] | The child toolbox items for this category. |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|--------------------------------------------------------------------------------------------------------------------------|-------------|-------------------------------------------------------------------|\n| [createDom_()](./blockly.collapsibletoolboxcategory_class.createdom__1_method.md) | | |\n| [createIconDom_()](./blockly.collapsibletoolboxcategory_class.createicondom__1_method.md) | | |\n| [createSubCategoriesDom_(subcategories)](./blockly.collapsibletoolboxcategory_class.createsubcategoriesdom__1_method.md) | `protected` | Create the DOM for all subcategories. |\n| [getChildToolboxItems()](./blockly.collapsibletoolboxcategory_class.getchildtoolboxitems_1_method.md) | | Gets any children toolbox items. (ex. Gets the subcategories) |\n| [getDiv()](./blockly.collapsibletoolboxcategory_class.getdiv_1_method.md) | | |\n| [init()](./blockly.collapsibletoolboxcategory_class.init_1_method.md) | | |\n| [isCollapsible()](./blockly.collapsibletoolboxcategory_class.iscollapsible_1_method.md) | | |\n| [isExpanded()](./blockly.collapsibletoolboxcategory_class.isexpanded_1_method.md) | | Whether the category is expanded to show its child subcategories. |\n| [makeDefaultCssConfig_()](./blockly.collapsibletoolboxcategory_class.makedefaultcssconfig__1_method.md) | | |\n| [onClick(_e)](./blockly.collapsibletoolboxcategory_class.onclick_1_method.md) | | |\n| [parseContents_(categoryDef)](./blockly.collapsibletoolboxcategory_class.parsecontents__1_method.md) | | |\n| [setExpanded(isExpanded)](./blockly.collapsibletoolboxcategory_class.setexpanded_1_method.md) | | Opens or closes the current category and the associated flyout. |\n| [setVisible_(isVisible)](./blockly.collapsibletoolboxcategory_class.setvisible__1_method.md) | | |\n| [toggleExpanded()](./blockly.collapsibletoolboxcategory_class.toggleexpanded_1_method.md) | | Toggles whether or not the category is expanded. |"]]