/** * Called when the uploader detects that the upload process has finished: - in the case of submit * complete. - in the case of error talking with the server. */ private void uploadFinished() { removeFromQueue(); finished = true; uploading = false; updateStatusTimer.cancel(); statusWidget.setVisible(false); if (successful) { if (avoidRepeatedFiles) { fileDone.addAll(fileInput.getFilenames()); statusWidget.setStatus(IUploadStatus.Status.SUCCESS); } else { statusWidget.setStatus(IUploadStatus.Status.SUCCESS); } } else if (canceled) { statusWidget.setStatus(IUploadStatus.Status.CANCELED); } else { statusWidget.setStatus(IUploadStatus.Status.ERROR); } onFinishUpload(); reatachIframe(uploadForm.getElement().getAttribute("target")); }