Blockly. ISelectableToolboxItem
Interface for an item in the toolbox that can be selected.
Properties
dispose
Dispose of this toolbox item. No-op by default.
- Inherited from
- Blockly.IToolboxItem#dispose
getClickTarget
Gets the html element that is clickable. The parent toolbox element receives clicks. The parent toolbox will add an id to this element so it can pass the onClick event to the correct toolboxItem.
- Returns
-
non-null Element
The html element that receives clicks.
getContents
Gets the contents of the toolbox item. These are items that are meant to be displayed in the flyout.
- Returns
-
(non-null Blockly.utils.toolbox.FlyoutItemInfoArray or string)
The definition of items to be displayed in the flyout.
getDiv
Gets the div for the toolbox item.
- Inherited from
- Blockly.IToolboxItem#getDiv
- Returns
-
The div for the toolbox item.
getId
Gets a unique identifier for this toolbox item.
- Inherited from
- Blockly.IToolboxItem#getId
- Returns
-
The id for the toolbox item.
getLevel
Gets the nested level of the category.
- Inherited from
- Blockly.IToolboxItem#getLevel
- Returns
-
The nested level of the category.
getName
Gets the name of the toolbox item. Used for emitting events.
- Returns
-
string
The name of the toolbox item.
getParent
Gets the parent if the toolbox item is nested.
- Inherited from
- Blockly.IToolboxItem#getParent
- Returns
-
The parent toolbox item, or null if this toolbox item is not nested.
init
Initializes the toolbox item. This includes creating the dom and updating the state of any items based on the info object.
- Inherited from
- Blockly.IToolboxItem#init
- Returns
isCollapsible
Whether the toolbox item is collapsible.
- Inherited from
- Blockly.IToolboxItem#isCollapsible
- Returns
-
True if the toolbox item is collapsible.
isSelectable
Whether the toolbox item is selectable.
- Inherited from
- Blockly.IToolboxItem#isSelectable
- Returns
-
True if the toolbox item can be selected.
onClick
Handles when the toolbox item is clicked.
Parameter |
|
---|---|
_e |
Event Click event to handle. Value must not be null. |
setSelected
Sets the current toolbox item as selected.
Parameter |
|
---|---|
_isSelected |
boolean True if this category is selected, false otherwise. |