Class: ToolboxSeparator
Defined in: packages/blockly/core/toolbox/separator.ts:26
Class for a toolbox separator. This is the thin visual line that appears on the toolbox. This item is not interactable.
Extends
Properties index
| Property | Description |
|---|---|
| registrationName | Name used for registering a toolbox separator. |
| cssConfig_ | All the CSS class names that are used to create a separator. |
| id_ | - |
| parent_ | - |
| level_ | - |
| toolboxItemDef_ | - |
| workspace_ | - |
| parentToolbox_ | The toolbox this category belongs to. |
Methods index
| Method | Description |
|---|---|
| init | Initializes the toolbox item. This includes creating the DOM and updating the state of any items based on the info object. |
| createDom_ | Creates the DOM for a separator. |
| getDiv | Gets the div for the toolbox item. |
| dispose | Dispose of this toolbox item. No-op by default. |
| canBeFocused | Prevents separator toolbox items from gaining focus. |
| 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. |
| getId | Gets a unique identifier for this toolbox item. |
| getParent | Gets the parent if the toolbox item is nested. |
| isSelectable | Whether the toolbox item is selectable. |
| isCollapsible | Whether the toolbox item is collapsible. |
| setVisible_ | Sets whether the category is visible or not. For a category to be visible its parent category must also be expanded. |
| getFocusableElement | See IFocusableNode.getFocusableElement. |
| getFocusableTree | See IFocusableNode.getFocusableTree. |
| onNodeFocus | See IFocusableNode.onNodeFocus. |
| onNodeBlur | See IFocusableNode.onNodeBlur. |
| getParentToolbox | Returns the toolbox this toolbox item belongs to. |
Constructors
Constructor
new ToolboxSeparator(separatorDef, toolbox): ToolboxSeparator;
Defined in: packages/blockly/core/toolbox/separator.ts:39
Parameters
| Parameter | Type | Description |
|---|---|---|
separatorDef | SeparatorInfo | The information needed to create a separator. |
toolbox | IToolbox | The parent toolbox for the separator. |
Returns
ToolboxSeparator
Overrides
Properties
registrationName
static registrationName: string = 'sep';
Defined in: packages/blockly/core/toolbox/separator.ts:28
Name used for registering a toolbox separator.
cssConfig_
protected cssConfig_: CssConfig;
Defined in: packages/blockly/core/toolbox/separator.ts:31
All the CSS class names that are used to create a separator.
id_
protected id_: string;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:26
Inherited from
parent_
protected parent_:
| ICollapsibleToolboxItem
| null;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:27
Inherited from
level_
protected level_: number;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:28
Inherited from
toolboxItemDef_
protected toolboxItemDef_:
| ToolboxItemInfo
| null;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:29
Inherited from
workspace_
protected workspace_: WorkspaceSvg;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:30
Inherited from
parentToolbox_
protected readonly parentToolbox_: IToolbox;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:32
The toolbox this category belongs to.
Inherited from
Methods
init()
init(): void;
Defined in: packages/blockly/core/toolbox/separator.ts:47
Initializes the toolbox item. This includes creating the DOM and updating the state of any items based on the info object.
Returns
void
Overrides
createDom_()
protected createDom_(): HTMLDivElement;
Defined in: packages/blockly/core/toolbox/separator.ts:56
Creates the DOM for a separator.
Returns
HTMLDivElement
The parent element for the separator.
getDiv()
getDiv(): HTMLDivElement;
Defined in: packages/blockly/core/toolbox/separator.ts:68
Gets the div for the toolbox item.
Returns
HTMLDivElement
The div for the toolbox item.
Overrides
dispose()
dispose(): void;
Defined in: packages/blockly/core/toolbox/separator.ts:72
Dispose of this toolbox item. No-op by default.
Returns
void
Overrides
canBeFocused()
canBeFocused(): boolean;
Defined in: packages/blockly/core/toolbox/separator.ts:79
Prevents separator toolbox items from gaining focus.
Returns
boolean
Overrides
getClickTarget()
getClickTarget(): Element | null;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:91
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
Element | null
The HTML element that receives clicks, or null if this item should not receive clicks.
Inherited from
getId()
getId(): string;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:100
Gets a unique identifier for this toolbox item.
Returns
string
The ID for the toolbox item.
Inherited from
getParent()
getParent():
| ICollapsibleToolboxItem
| null;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:110
Gets the parent if the toolbox item is nested.
Returns
| ICollapsibleToolboxItem
| null
The parent toolbox item, or null if this toolbox item is not nested.
Inherited from
isSelectable()
isSelectable(): boolean;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:129
Whether the toolbox item is selectable.
Returns
boolean
True if the toolbox item can be selected.
Inherited from
isCollapsible()
isCollapsible(): boolean;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:138
Whether the toolbox item is collapsible.
Returns
boolean
True if the toolbox item is collapsible.
Inherited from
setVisible_()
setVisible_(_isVisible): void;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:151
Sets whether the category is visible or not. For a category to be visible its parent category must also be expanded.
Parameters
| Parameter | Type | Description |
|---|---|---|
_isVisible | boolean | True if category should be visible. |
Returns
void
Inherited from
getFocusableElement()
getFocusableElement(): HTMLElement | SVGElement;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:154
See IFocusableNode.getFocusableElement.
Returns
HTMLElement | SVGElement
Inherited from
ToolboxItem.getFocusableElement
getFocusableTree()
getFocusableTree(): IFocusableTree;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:166
See IFocusableNode.getFocusableTree.
Returns
Inherited from
onNodeFocus()
onNodeFocus(): void;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:171
See IFocusableNode.onNodeFocus.
Returns
void
Inherited from
onNodeBlur()
onNodeBlur(): void;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:181
See IFocusableNode.onNodeBlur.
Returns
void
Inherited from
getParentToolbox()
getParentToolbox(): IToolbox;
Defined in: packages/blockly/core/toolbox/toolbox_item.ts:191
Returns the toolbox this toolbox item belongs to.