}
return elementToIndexMap;
}
private void expand(final DefaultMutableTreeNode node, final NodeDescriptor descriptor, final boolean wasLeaf) {
final Alarm alarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
alarm.addRequest(new Runnable() {
public void run() {
myTree.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
}
}, WAIT_CURSOR_DELAY);
if (wasLeaf && isAutoExpandNode(descriptor)) {
expand(node);
}
ArrayList<TreeNode> nodes = TreeUtil.childrenToArray(node);
for (TreeNode node1 : nodes) {
DefaultMutableTreeNode childNode = (DefaultMutableTreeNode)node1;
if (isLoadingNode(childNode)) continue;
NodeDescriptor childDescr = (NodeDescriptor)childNode.getUserObject();
if (isAutoExpandNode(childDescr)) {
expand(childNode);
}
}
int n = alarm.cancelAllRequests();
if (n == 0) {
myTree.setCursor(Cursor.getDefaultCursor());
}
}