use of com.oxygenxml.git.view.NodeTreeComparator in project oxygen-git-client-addon by oxygenxml.
the class TreeUtil method sort.
/**
* Sorts the given node
*
* @param node The node to be sorted.
*/
private static void sort(GitTreeNode node) {
int childCount = node.getChildCount();
List<GitTreeNode> children = new ArrayList<>(childCount);
for (int i = 0; i < childCount; i++) {
children.add((GitTreeNode) node.getChildAt(i));
}
Collections.sort(children, new NodeTreeComparator());
node.removeAllChildren();
children.forEach(node::add);
}
Aggregations