Subclass this to create a broker between your data and a [[Tree]] to display and manipulate it. The [[Tree]] doesn't know how your data is structured and how to handle it, the controller implements the methods needed

Type Parameters

  • T

Constructors

Properties

copyPaste: {
    sources: T[];
    target: T;
} = ...

Stores references to objects being dragged, and objects to drop on. Override with a reference in outer scope, if drag&drop should operate outside of tree

Type declaration

  • sources: T[]
  • target: T
dragDrop: {
    sources: T[];
    target: T;
} = ...

Stores references to objects being dragged, and objects to drop on. Override with a reference in outer scope, if drag&drop should operate outside of tree

Type declaration

  • sources: T[]
  • target: T
selection: T[] = []

Stores references to selected objects. Override with a reference in outer scope, if selection should also operate outside of tree

Methods

  • Process the list of source objects to be addedAsChildren when dropping or pasting onto the target item/object, return the list of objects that should visibly become the children of the target item/object

    Parameters

    • _sources: T[]
    • _target: T

      The object referenced by the item the drop occurs on

    Returns T[]

  • Remove the objects to be deleted, e.g. the current selection, from the data structure the tree refers to and return a list of those objects in order for the according [[TreeItems]] to be deleted also

    Parameters

    • _focussed: T[]

      The object currently having focus

    Returns T[]

  • Retrieve a space separated string of attributes to add to the list item representing the object for further styling

    Parameters

    • _object: T

    Returns string

  • Return true if the object has children that must be shown when unfolding the tree item

    Parameters

    • _object: T

    Returns boolean

  • Return false to disallow renaming the item/object, or processes the proposed new label

    Parameters

    • _object: T
    • _new: string

    Returns boolean