Skip to main content

Class: ButtonFlyoutInflater

Defined in: packages/blockly/core/button_flyout_inflater.ts:19

Class responsible for creating buttons for flyouts.

Implements

Methods index

MethodDescription
loadInflates a flyout button from the given state and adds it to the flyout.
gapForItemReturns the amount of space that should follow this button.
disposeItemDisposes of the given button.
getTypeReturns the type of items this inflater is responsible for creating.

Constructors

Constructor

new ButtonFlyoutInflater(): ButtonFlyoutInflater;

Returns

ButtonFlyoutInflater

Methods

load()

load(state, flyout): FlyoutItem;

Defined in: packages/blockly/core/button_flyout_inflater.ts:27

Inflates a flyout button from the given state and adds it to the flyout.

Parameters

ParameterTypeDescription
stateobjectA JSON representation of a flyout button.
flyoutIFlyoutThe flyout to create the button on.

Returns

FlyoutItem

A newly created FlyoutButton.

Implementation of

IFlyoutInflater.load


gapForItem()

gapForItem(state, defaultGap): number;

Defined in: packages/blockly/core/button_flyout_inflater.ts:46

Returns the amount of space that should follow this button.

Parameters

ParameterTypeDescription
stateobjectA JSON representation of a flyout button.
defaultGapnumberThe default spacing for flyout items.

Returns

number

The amount of space that should follow this button.

Implementation of

IFlyoutInflater.gapForItem


disposeItem()

disposeItem(item): void;

Defined in: packages/blockly/core/button_flyout_inflater.ts:55

Disposes of the given button.

Parameters

ParameterTypeDescription
itemFlyoutItemThe flyout button to dispose of.

Returns

void

Implementation of

IFlyoutInflater.disposeItem


getType()

getType(): string;

Defined in: packages/blockly/core/button_flyout_inflater.ts:67

Returns the type of items this inflater is responsible for creating.

Returns

string

An identifier for the type of items this inflater creates.

Implementation of

IFlyoutInflater.getType