}
}
public void updateChildCells(TreePath treePath, int col) {
if (tree.getModel() instanceof TestCampaignTreeModel) {
TestCampaignTreeModel model = (TestCampaignTreeModel) tree.getModel();
// get the node associated to the treepath
TCTreeNode node = (TCTreeNode) treePath.getLastPathComponent();
JTreeNode fNode = null;
// retrieve userObject only if based on a JTreeNode
if (node.getUserObject() instanceof FileNode || node.getUserObject() instanceof TestDataNode) {
fNode = (JTreeNode) node.getUserObject();
}
int childCount = node.getChildCount();
if (fNode != null) {
childCount = fNode.getChildren().length;
} // it can be different is user didn't expand the tree view
String testbedName = model.getColumnName(col);
if (fNode != null) {
model.updateChild(fNode, testbedName);
return;
} else {
// update child from root
for (int i = 0; i < childCount; i++) {
TCTreeNode childNode = (TCTreeNode) node.getChildAt(i);
JTreeNode childFileNode = (JTreeNode) childNode.getUserObject();
// set the value to child from its parent
TristateCheckBox.State rootState = model.getNodeState(node.toString(), testbedName);
model.setNodeState(childFileNode, testbedName, rootState);
model.updateChild(childFileNode, testbedName);
}
}
}
}