if(chooser.checkPath(rootPath, 0)) {
return(rootPath);
}
Timeouts times = timeouts.cloneThis();
times.setTimeout("Waiter.WaitingTime", timeouts.getTimeout("JTreeOperator.WaitNextNodeTimeout"));
Waiter loadedWaiter = new Waiter(new Waitable() {
// fields used in getDescription() method
TreePath currentPath;
String requestedPath;
public Object actionProduced(Object obj) {
TreePathChooser chsr = (TreePathChooser)((Object[])obj)[0];
requestedPath = chsr.getDescription();
TreePath path = (TreePath)((Object[])obj)[1];
currentPath = path;
Object[] result = new Object[2];
Object[] children = getChildren(path.getLastPathComponent());
for(int j = 0; j < children.length; j++) {
result[0] = path.pathByAddingChild(children[j]);
if(chsr.checkPath((TreePath)result[0], j)) {
result[1] = Boolean.TRUE;
return(result);
}
if(chsr.hasAsParent((TreePath)result[0], j)) {
result[1] = Boolean.FALSE;
return(result);
}
}
return(null);
}
public String getDescription() {
return "Wait next node loaded under parent "+currentPath+ " when requested was "+requestedPath;
}
});
loadedWaiter.setTimeouts(times);
loadedWaiter.setOutput(output.createErrorOutput());
return(findPathPrimitive(rootPath, chooser, loadedWaiter));
}