Examples of BundleFileUploadForm


Examples of org.rhq.coregui.client.components.upload.BundleFileUploadForm

            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));
                }
            });

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.