Programmatic access
Stay organized with collections
Save and categorize content based on your preferences.
There are two ways you can access a category programmatically. You can either
access it by index (where 0 is the top category):
var category = toolbox.getToolboxItems()[0];
Or by ID:
var category = toolbox.getToolboxItemById('categoryId');
Where the ID is specified in the toolbox definition:
JSON
{
"kind": "category",
"name": "...",
"toolboxitemid": "categoryId"
}
XML
<category name="..." toolboxitemid="categoryId"></category>
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-09-16 UTC.
[null,null,["Last updated 2025-09-16 UTC."],[],[],null,[]]