Skip to content
pixi-silk
GitHub repository
Interface

PixiTreeAdapter

import type { PixiTreeAdapter } from 'pixi-silk/ui/layers';

What pixiTreeAdapter returns: an adapter for containers, plus the lock state it keeps.

Extends#

Methods#

canHaveChildren()#

canHaveChildren(node: Container): boolean;

True when other nodes can be dropped inside. Default: when it has children.

Parameters#

ParameterType
nodeContainer

Returns#

boolean

Inherited from#

Required.canHaveChildren

getChildren()#

getChildren(node: Container): readonly Container<ContainerChild>[];

The children of node, in display order.

Parameters#

ParameterType
nodeContainer

Returns#

readonly Container<ContainerChild>[]

Inherited from#

Required.getChildren

getIcon()#

getIcon(node: Container): LayerIcon | null;

The row icon: the icon option’s result, or one picked from the kind of display object.

Parameters#

ParameterType
nodeContainer

Returns#

LayerIcon | null


getName()#

getName(node: Container): string;

The name shown in the row.

Parameters#

ParameterType
nodeContainer

Returns#

string

Inherited from#

Required.getName

getParent()#

getParent(node: Container): Container<ContainerChild> | null;

The parent of node, or null for the root. Without it the tree searches from the root.

Parameters#

ParameterType
nodeContainer

Returns#

Container<ContainerChild> | null

Inherited from#

Required.getParent

isLocked()#

isLocked(node: Container): boolean;

True when the node is locked. Without it, the row has no lock toggle.

Parameters#

ParameterType
nodeContainer

Returns#

boolean

Inherited from#

Required.isLocked

isVisible()#

isVisible(node: Container): boolean;

True when the node shows. Without it, the row has no eye toggle.

Parameters#

ParameterType
nodeContainer

Returns#

boolean

Inherited from#

Required.isVisible

move()#

move(
   node: Container, 
   parent: Container, 
   index: number
): void;

Moves node under parent at index in display order, counted without node itself. Without it, rows cannot be dragged.

Parameters#

ParameterType
nodeContainer
parentContainer
indexnumber

Returns#

void

Inherited from#

Required.move

setLocked()#

setLocked(node: Container, locked: boolean): void;

Sets the lock of node. Needed for the lock toggle to work.

Parameters#

ParameterType
nodeContainer
lockedboolean

Returns#

void

Inherited from#

Required.setLocked

setName()#

setName(node: Container, name: string): void;

Renames node. Without it, double click, Enter and F2 do nothing.

Parameters#

ParameterType
nodeContainer
namestring

Returns#

void

Inherited from#

Required.setName

setVisible()#

setVisible(node: Container, visible: boolean): void;

Shows or hides node. Needed for the eye toggle to work.

Parameters#

ParameterType
nodeContainer
visibleboolean

Returns#

void

Inherited from#

Required.setVisible