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;
}
Aggregations