Interface: ISelectableToolboxItem

Properties

dispose

public

Dispose of this toolbox item. No-op by default.

Inherited from
Blockly.IToolboxItem#dispose

getClickTarget

public

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

public

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

public

Gets the div for the toolbox item.

Inherited from
Blockly.IToolboxItem#getDiv
Returns

The div for the toolbox item.

getId

public

Gets a unique identifier for this toolbox item.

Inherited from
Blockly.IToolboxItem#getId
Returns

The id for the toolbox item.

getLevel

package

Gets the nested level of the category.

Inherited from
Blockly.IToolboxItem#getLevel
Returns

The nested level of the category.

getName

public

Gets the name of the toolbox item. Used for emitting events.

Returns

string The name of the toolbox item.

getParent

public

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

public

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

public

Whether the toolbox item is collapsible.

Inherited from
Blockly.IToolboxItem#isCollapsible
Returns

True if the toolbox item is collapsible.

isSelectable

public

Whether the toolbox item is selectable.

Inherited from
Blockly.IToolboxItem#isSelectable
Returns

True if the toolbox item can be selected.

onClick

public

Handles when the toolbox item is clicked.

Parameter

_e

Event

Click event to handle.

Value must not be null.

setSelected

public

Sets the current toolbox item as selected.

Parameter

_isSelected

boolean

True if this category is selected, false otherwise.