Skip to main content

Class: ToolboxItemNavigationPolicy

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.ts:18

Set of rules controlling keyboard navigation from a toolbox item.

Implements

Methods index

MethodDescription
getFirstChildReturns the first child of the given toolbox item.
getParentReturns the parent of the given toolbox item.
getNextSiblingReturns the next sibling of the given toolbox item.
getPreviousSiblingReturns the previous sibling of the given toolbox item.
getRowIdReturns the row ID of the given toolbox item.
isNavigableReturns whether or not the given toolbox item can be navigated to.
isApplicableReturns whether the given object can be navigated from by this policy.

Constructors

Constructor

new ToolboxItemNavigationPolicy(): ToolboxItemNavigationPolicy;

Returns

ToolboxItemNavigationPolicy

Methods

getFirstChild()

getFirstChild(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.ts:25

Returns the first child of the given toolbox item.

Parameters

ParameterTypeDescription
currentIToolboxItemThe toolbox item to return the first child of.

Returns

IFocusableNode | null

The child item of a collapsible toolbox item, otherwise null.

Implementation of

INavigationPolicy.getFirstChild


getParent()

getParent(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.ts:39

Returns the parent of the given toolbox item.

Parameters

ParameterTypeDescription
currentIToolboxItemThe toolbox item to return the parent of.

Returns

IFocusableNode | null

The parent toolbox item of the given toolbox item, if any.

Implementation of

INavigationPolicy.getParent


getNextSibling()

getNextSibling(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.ts:49

Returns the next sibling of the given toolbox item.

Parameters

ParameterTypeDescription
currentIToolboxItemThe toolbox item to return the next sibling of.

Returns

IFocusableNode | null

The next toolbox item, or null.

Implementation of

INavigationPolicy.getNextSibling


getPreviousSibling()

getPreviousSibling(current): IFocusableNode | null;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.ts:61

Returns the previous sibling of the given toolbox item.

Parameters

ParameterTypeDescription
currentIToolboxItemThe toolbox item to return the previous sibling of.

Returns

IFocusableNode | null

The previous toolbox item, or null.

Implementation of

INavigationPolicy.getPreviousSibling


getRowId()

getRowId(current): string;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.ts:73

Returns the row ID of the given toolbox item.

Parameters

ParameterTypeDescription
currentIToolboxItemThe toolbox item to retrieve the row ID of.

Returns

string

The row ID of the given toolbox item.

Implementation of

INavigationPolicy.getRowId


isNavigable()

isNavigable(current): boolean;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.ts:83

Returns whether or not the given toolbox item can be navigated to.

Parameters

ParameterTypeDescription
currentIToolboxItemThe instance to check for navigability.

Returns

boolean

True if the given toolbox item can be focused.

Implementation of

INavigationPolicy.isNavigable


isApplicable()

isApplicable(current): current is IToolboxItem;

Defined in: packages/blockly/core/keyboard_nav/navigation_policies/toolbox_item_navigation_policy.ts:100

Returns whether the given object can be navigated from by this policy.

Parameters

ParameterTypeDescription
currentanyThe object to check if this policy applies to.

Returns

current is IToolboxItem

True if the object is an IToolboxItem.

Implementation of

INavigationPolicy.isApplicable