Namespace: toolbox

Enumeration

Position

static

number

Position of the the toolbox and/or flyout relative to the workspace.

Value

TOP

BOTTOM

LEFT

RIGHT

Properties

CATEGORY_TOOLBOX_KIND

constant   static

string

The name used to identify a toolbox that has category like items. This only needs to be used if a toolbox wants to be treated like a category toolbox but does not actually contain any toolbox items with the kind 'category'.

FLYOUT_TOOLBOX_KIND

constant   static

string

The name used to identify a toolbox that has no categories and is displayed as a simple flyout displaying blocks, buttons, or labels.

Position

static

number

Position of the the toolbox and/or flyout relative to the workspace.

Value

TOP

BOTTOM

LEFT

RIGHT

Methods

convertFlyoutDefToJsonArray

package   static

convertFlyoutDefToJsonArray(flyoutDef) returns Blockly.utils.toolbox.FlyoutItemInfoArray

Converts the flyout definition into a list of flyout items.

Parameter

flyoutDef

Blockly.utils.toolbox.FlyoutDefinition

The definition of the flyout in one of its many forms.

Value may be null.

Returns

non-null Blockly.utils.toolbox.FlyoutItemInfoArray A list of flyout items.

convertToolboxDefToJson

package   static

convertToolboxDefToJson(toolboxDef) returns Blockly.utils.toolbox.ToolboxInfo

Converts the toolbox definition into toolbox JSON.

Parameter

toolboxDef

Blockly.utils.toolbox.ToolboxDefinition

The definition of the toolbox in one of its many forms.

Value may be null.

Returns

nullable Blockly.utils.toolbox.ToolboxInfo Object holding information for creating a toolbox.

hasCategories

package   static

hasCategories(toolboxJson) returns boolean

Whether or not the toolbox definition has categories.

Parameter

toolboxJson

Blockly.utils.toolbox.ToolboxInfo

Object holding information for creating a toolbox.

Value may be null.

Returns

boolean True if the toolbox has categories.

isCategoryCollapsible

package   static

isCategoryCollapsible(categoryInfo) returns boolean

Whether or not the category is collapsible.

Parameter

categoryInfo

Blockly.utils.toolbox.CategoryInfo

Object holing information for creating a category.

Value must not be null.

Returns

boolean True if the category has subcategories.

parseToolboxTree

static

parseToolboxTree(toolboxDef) returns Node

Parse the provided toolbox tree into a consistent DOM format.

Parameter

toolboxDef

(nullable Node or nullable string)

DOM tree of blocks, or text representation of same.

Returns

nullable Node DOM tree of blocks, or null.

Abstract types

BlockInfo

static

{kind:string, blockxml: (string, non-null Node, or undefined), type: (string or undefined), gap: (string, number, or undefined), disabled: (string, boolean, or undefined)}

The information needed to create a block in the toolbox.

ButtonInfo

static

{kind:string, text:string, callbackkey:string}

The information needed to create a button in the toolbox.

ButtonOrLabelInfo

static

(Blockly.utils.toolbox.ButtonInfo or Blockly.utils.toolbox.LabelInfo)

The information needed to create either a button or a label in the flyout.

CategoryInfo

static

(Blockly.utils.toolbox.StaticCategoryInfo or Blockly.utils.toolbox.DynamicCategoryInfo)

The information needed to create either a dynamic or static category.

DynamicCategoryInfo

static

{kind:string, custom:string, id: (string or undefined), categorystyle: (string or undefined), colour: (string or undefined), cssconfig: (non-null Blockly.ToolboxCategory.CssConfig or undefined), hidden: (string or undefined)}

The information needed to create a custom category.

FlyoutDefinition

static

(Blockly.utils.toolbox.FlyoutItemInfoArray, NodeList, Blockly.utils.toolbox.ToolboxInfo, or Array of non-null Node)

All of the different types that can be used to show items in a flyout.

FlyoutItemInfo

static

(Blockly.utils.toolbox.BlockInfo, Blockly.utils.toolbox.SeparatorInfo, Blockly.utils.toolbox.ButtonInfo, Blockly.utils.toolbox.LabelInfo, or Blockly.utils.toolbox.DynamicCategoryInfo)

All the different types that can be displayed in a flyout.

FlyoutItemInfoArray

static

Array of non-null Blockly.utils.toolbox.FlyoutItemInfo

An array holding flyout items.

LabelInfo

static

{kind:string, text:string, id: (string or undefined)}

The information needed to create a label in the toolbox.

SeparatorInfo

static

{kind:string, id: (string or undefined), gap: (number or undefined), cssconfig: (non-null Blockly.ToolboxSeparator.CssConfig or undefined)}

The information needed to create a separator in the toolbox.

StaticCategoryInfo

static

{kind:string, name:string, contents: non-null Array of non-null Blockly.utils.toolbox.ToolboxItemInfo, id: (string or undefined), categorystyle: (string or undefined), colour: (string or undefined), cssconfig: (non-null Blockly.ToolboxCategory.CssConfig or undefined), hidden: (string or undefined)}

The information needed to create a category in the toolbox.

ToolboxDefinition

static

(Node, Blockly.utils.toolbox.ToolboxInfo, or string)

All of the different types that can create a toolbox.

ToolboxInfo

static

{kind: (string or undefined), contents: non-null Array of non-null Blockly.utils.toolbox.ToolboxItemInfo}

The JSON definition of a toolbox.

ToolboxItemInfo

static

(Blockly.utils.toolbox.FlyoutItemInfo or Blockly.utils.toolbox.StaticCategoryInfo)

Any information that can be used to create an item in the toolbox.