uploadsLayout.removeComponent(source);
}
protected void addUpload() {
Upload upload = createUpload();
upload.addSucceededListener(new SucceededListener() {
@Override
public void uploadSucceeded(SucceededEvent event) {
log("Upload of " + event.getFilename() + " complete");
uploadsLayout.removeComponent(event.getUpload());
}
});
upload.addFailedListener(new FailedListener() {
@Override
public void uploadFailed(FailedEvent event) {
log("Upload of " + event.getFilename() + " FAILED");
}
});
upload.setReceiver(new Receiver() {
@Override
public OutputStream receiveUpload(String filename, String mimeType) {
return new OutputStream() {
@Override
public void write(int arg0) throws IOException {
}
};
}
});
upload.setStyleName("hidden-button");
uploadsLayout.addComponent(upload);
}