blockly > Toolbox > setSelectedItem
Sets the given item as selected. No-op if the item is not selectable.
Signature:
setSelectedItem(newItem: IToolboxItem | null): void;
Parameters
Parameter |
Type |
Description |
newItem |
IToolboxItem | null |
The toolbox item to select. |
Returns:
void
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 `Toolbox.setSelectedItem()` method selects a specified item within the toolbox."],["If the provided item is not selectable, calling this method has no effect."],["This method accepts one argument: the `IToolboxItem` to select or null to deselect."],["Calling `setSelectedItem()` does not return any value (void)."]]],[]]