* Recursive method only to be called from {@link TreeViewWidget#checkExpand(TreePath)}
* CraigM:29/07/2008.
*/
@SuppressWarnings("unchecked")
private void checkExpand(TreePath parent, HashMap<DisplayNode, Boolean> isOpenedStates) {
DisplayNode node = (DisplayNode)parent.getLastPathComponent();
// CraigM:29/07/2008 - We need to store all the isOpened states as when we ask a node to expand/collapse, the parent
// nodes are automatically expanded, which overrides the correct isOpened value.
if (isOpenedStates == null) {
isOpenedStates = new HashMap<DisplayNode, Boolean>();
ArrayList<DisplayNode> nodes = this.getNodes(node);
for (DisplayNode aNode : nodes) {
isOpenedStates.put(aNode, aNode.isOpened());
}
}
if (node.getChildCount() > 0){
for (Enumeration<DisplayNode> e = node.children(); e.hasMoreElements();){
TreePath path = parent.pathByAddingChild(e.nextElement());
checkExpand(path, isOpenedStates);
}
}
// CraigM:29/07/2008 - Use the stored isOpened value