// Check to see if this is a leaf
Element e = client.getElement(nodeID+":handle:img");
if( e == null ) {
// Make sure we are currently closed
HtmlImage collapsed = (HtmlImage)client.getElement(nodeID+":handle:img:collapsed");
assertNotNull("Can't find node 'collapsed' handle ["+nodeID+":handle:img:collapsed"+"]",collapsed);
HtmlImage expanded = (HtmlImage)client.getElement(nodeID+":handle:img:expanded");
assertNotNull("Can't find node 'expanded' handle ["+nodeID+":handle:img:expanded"+"]",expanded);
assertFalse("",collapsed.getStyleAttribute().contains("none"));
assertTrue("",expanded.getStyleAttribute().contains("none"));
// Click on the current node
richClient.clickTreeNodeHandle( key, getNodeTemplateId(type,node) );
// Make sure we are currently open
collapsed = (HtmlImage)client.getElement(nodeID+":handle:img:collapsed");
assertNotNull("Can't find node 'collapsed' handle ["+nodeID+":handle:img:collapsed"+"]",collapsed);
expanded = (HtmlImage)client.getElement(nodeID+":handle:img:expanded");
assertNotNull("Can't find node 'expanded' handle ["+nodeID+":handle:img:expanded"+"]",expanded);
assertFalse("",expanded.getStyleAttribute().contains("none"));
assertTrue("",collapsed.getStyleAttribute().contains("none"));
// Check the children for their nodes
Iterator i = node.getChildren();
while( i.hasNext() ) {
Entry entry = (Entry) i.next();
TreeNode child = (TreeNode)entry.getValue();
checkTreeNode( type, (String)entry.getKey(), child );
}
//Click on the current node to close
richClient.clickTreeNodeHandle( key, getNodeTemplateId(type, node) );
// Make sure we are currently closed
collapsed = (HtmlImage)client.getElement(nodeID+":handle:img:collapsed");
assertNotNull("Can't find node 'collapsed' handle ["+nodeID+":handle:img:collapsed"+"]",collapsed);
expanded = (HtmlImage)client.getElement(nodeID+":handle:img:expanded");
assertNotNull("Can't find node 'expanded' handle ["+nodeID+":handle:img:expanded"+"]",expanded);
assertFalse("",collapsed.getStyleAttribute().contains("none"));
assertTrue("",expanded.getStyleAttribute().contains("none"));
}
}