SelectionAPI

Interface SelectionAPI

The SelectionAPI provides basic functionalities to manipulate the current selection of Nodes.

interface SelectionAPI {
    addToSelection(
        nodeID: number | number[],
        silent?: boolean,
    ): Promise<ChangeSelectionResult>;
    clearSelection(silent?: boolean): Promise<ChangeSelectionResult>;
    getSelectedLeafNodes(): number[];
    getSelectedNodes(): number[];
    getSelection(): Promise<number[]>;
    invertSelection(silent?: boolean): Promise<ChangeSelectionResult>;
    isSelected(nodeID: number): Promise<boolean>;
    removeFromSelection(
        nodeID: number | number[],
        silent?: boolean,
    ): Promise<ChangeSelectionResult>;
    selectCollection(
        collectionID: number,
        silent?: boolean,
    ): Promise<void | ChangeSelectionResult>;
    setSelection(
        nodeID: number | number[],
        silent?: boolean,
    ): Promise<ChangeSelectionResult>;
}

Hierarchy (View Summary)

Methods

  • Adds the given Nodes to the Selection.

    Parameters

    • nodeID: number | number[]

      The ID of the Node that should be added to the current Selection

    • Optionalsilent: boolean

      If set to true, no event will be emitted.

    Returns Promise<ChangeSelectionResult>

  • Returns a list of all selected nodes.

    Returns number[]

    An array which contains the IDs of all Nodes in the current Selection.

  • Returns all selected leaf nodes.

    Returns number[]

    An array which contains the IDs of all leaf Nodes in the current Selection.

  • Returns a list of all selected nodes.

    Returns Promise<number[]>

    An array which contains the IDs of all leaf Nodes in the current Selection.

    getSelection is deprecated, please use getSelectedNodes instead.

  • Checks if the specified Node is part of the selection.

    Parameters

    • nodeID: number

      The ID of the node for which we would like to know if it is selected or not.

    Returns Promise<boolean>

    True of the given node is selected, otherwise false.

  • Removes the given nodes from the Selection

    Parameters

    • nodeID: number | number[]

      The ID of the Node that should be removed from the current Selection

    • Optionalsilent: boolean

      If set to true, no event will be emitted.

    Returns Promise<ChangeSelectionResult>

  • Replaces the current Selection with the Nodes from the given Collection.

    Parameters

    • collectionID: number

      The ID of the Collection.

    • Optionalsilent: boolean

      If set to true, no event will be emitted.

    Returns Promise<void | ChangeSelectionResult>

  • Replaces the current Selection with the specified nodes.

    Parameters

    • nodeID: number | number[]

      The nodeID(s) to select.

    • Optionalsilent: boolean

      If set to true, no event will be emitted.

    Returns Promise<ChangeSelectionResult>


Did you find this page useful? Please give it a rating:
Thank you for rating this page!
Any issues or feedback?
What kind of problem would you like to report?
Please tell us more about what's wrong: