bayrell / BayLang

BayLang compiler source code
https://bayrell.org/ru/docs/baylang
Apache License 2.0
4 stars 0 forks source link

Интерфейсы работы с деревом Tree #164

Open ildar-ceo opened 2 months ago

ildar-ceo commented 2 months ago

Модель работы с деревом

interface TreeInterface
{
    TreeItem getRoot();
    TreeItem getItem(Collection<int> path);
    Collection<path> getSelected();
    void selectItem(Collection<int> path);
    Collection<path> addItem(TreeItem item, Collection<int> path, InsertType kind = InsertType.AFTER);
    void removeItem(Collection<int> path);
    Collection<int> moveItem(Collection<int> src, Collection<int> dest, InsertType kind = InsertType.AFTER);
}

Элементы дерева

class TreeItem
{
    string key = "";
    string label = "";
    Collection<TreeItem> items = [];
}