Search in sources :

Example 1 with StructureTreeModel

use of com.intellij.ui.tree.StructureTreeModel in project consulo by consulo.

the class TodoPanel method setupTreeStructure.

private TodoTreeBuilder setupTreeStructure() {
    TodoTreeBuilder todoTreeBuilder = createTreeBuilder(myTree, myProject);
    TodoTreeStructure structure = todoTreeBuilder.getTodoTreeStructure();
    StructureTreeModel structureTreeModel = new StructureTreeModel(structure, TodoTreeBuilder.NODE_DESCRIPTOR_COMPARATOR, this);
    AsyncTreeModel asyncTreeModel = new AsyncTreeModel(structureTreeModel, myProject);
    myTree.setModel(asyncTreeModel);
    asyncTreeModel.addTreeModelListener(new MyExpandListener(todoTreeBuilder));
    todoTreeBuilder.setModel(structureTreeModel);
    Object selectableElement = structure.getFirstSelectableElement();
    if (selectableElement != null) {
        todoTreeBuilder.select(selectableElement);
    }
    return todoTreeBuilder;
}
Also used : AsyncTreeModel(com.intellij.ui.tree.AsyncTreeModel) StructureTreeModel(com.intellij.ui.tree.StructureTreeModel)

Aggregations

AsyncTreeModel (com.intellij.ui.tree.AsyncTreeModel)1 StructureTreeModel (com.intellij.ui.tree.StructureTreeModel)1