nameLabel.setWidth("*");
nameLabel.setAlign(Alignment.RIGHT);
nameLabel.setLayoutAlign(VerticalAlignment.CENTER);
indivLayout.addMember(nameLabel);
final BundleFileUploadForm uploadForm = new BundleFileUploadForm(this.wizard.getBundleVersion(),
fileToBeUploaded, false, (isAlreadyUploaded) ? Boolean.TRUE : null);
uploadForm.setWidth("75%");
indivLayout.addMember(uploadForm);
uploadForm.addFormHandler(new DynamicFormHandler() {
public void onSubmitComplete(DynamicFormSubmitCompleteEvent event) {
String results = event.getResults();
if (!results.contains("Failed to upload bundle file")) { // this is looking for an error message coming from the server, its not i18n'ed
allFilesStatus.put(uploadForm.getName(), Boolean.TRUE);
} else {
allFilesStatus.put(uploadForm.getName(), Boolean.FALSE);
String errorMessage = uploadForm.getUploadError();
handleUploadError(errorMessage, true);
}
}
});
uploadForm.addFormSubmitFailedHandler(new FormSubmitFailedHandler() {
public void onFormSubmitFailed(FormSubmitFailedEvent event) {
allFilesStatus.put(uploadForm.getName(), Boolean.FALSE);
CoreGUI.getMessageCenter().notify(
new Message(MSG.view_bundle_createWizard_failedToUploadFile(), Message.Severity.Error));
}
});