//End of mapping //
////////////////////////////////////////////////////////
private void waitPainted(int index) {
Waiter drawingWaiter = new Waiter(new Waitable() {
public Object actionProduced(Object param) {
JList list = getFileList();
int last_one = list.getModel().getSize() - 1;
if(last_one == -1) {
return("");
}
int current = (param != null) ? ((Integer)param).intValue() : 0;
try {
if(list.getCellBounds(current, current) != null) {
return(list.getCellBounds(last_one, last_one));
} else {
return(null);
}
} catch(NullPointerException e) {
//sometimes thrown from list.getCellBounds when item exists but not painted
return(null);
}
}
public String getDescription() {
return("List drawed");
}
});
drawingWaiter.setTimeouts(getTimeouts().cloneThis());
drawingWaiter.
getTimeouts().
setTimeout("Waiter.WaitingTime",
getTimeouts().
getTimeout("JFileChooserOperator.WaitListPaintedTimeout"));
drawingWaiter.setOutput(getOutput().createErrorOutput());
try {
drawingWaiter.waitAction((index != -1) ? new Integer(index) : null);
} catch(InterruptedException e) {
output.printStackTrace(e);
}
}