Package gwtupload.client

Examples of gwtupload.client.MultiUploader


       
        // Attach the image viewer to the document
        RootPanel.get().add(panelImages);
       
        // Create a new uploader panel and attach it to the document
        MultiUploader defaultUploader = new MultiUploader();
        RootPanel.get().add(defaultUploader);

        // Add a finish handler which will load the image once the upload finishes
        defaultUploader.addOnFinishUploadHandler(onFinishUploaderHandler);
       
       
//        RootLayoutPanel.get().add(getSimpleLayoutPanel());
//
//      ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART);
View Full Code Here


      alturaAgua.addKeyboardListener(new KeyNumeric());
     
     
      // Attach the image viewer to the document
        // Create a new uploader panel and attach it to the document
        MultiUploader defaultUploader = new MultiUploader();
    
        // Add a finish handler which will load the image once the upload finishes
        defaultUploader.addOnFinishUploadHandler(onFinishUploaderHandler);
       
        labelFoto.setText("Despues de los arreglos");
       
     
      parcelaDTO = new ParcelaDTO();
View Full Code Here

        final AbsolutePanel statusPanel = new AbsolutePanel();
        headerLabel.setSize("380px", "39px");
        headerLabel.setStyleName("header-style");
        absolutePanel.add(headerLabel, 10, 10);

        final MultiUploader uploader = new GTNMultiUploader();
        uploader.setAvoidRepeatFiles(false);
        absolutePanel.add(uploader, 10, 46);
        uploader.setSize("380px", "32px");
        uploader.addOnChangeUploadHandler(new IUploader.OnChangeUploaderHandler() {

            @Override
            public void onChange(IUploader uploader) {
                // Nothing to do
                if (uploader.getFileName() != null) {
                    importButton.setEnabled(true);
                }
            }
        });

        // Add a finish handler which will notify user once the upload finishes
        uploader.addOnFinishUploadHandler(new IUploader.OnFinishUploaderHandler() {

            public void onFinish(IUploader uploader) {

                switch (uploader.getStatus()) {
                    case SUCCESS:
                        statusLabel.setText("File uploaded with success");
                        statusLabel.setStyleName("success-style");
                        statusImg.setStyleName("success-style-icon");
                        break;
                    case ERROR:
                        statusLabel.setText("File upload error");
                        statusLabel.setStyleName("error-style");
                        statusImg.setStyleName("error-style-icon");
                        break;
                    case CANCELED:
                        statusLabel.setText("File upload canceled");
                        statusLabel.setStyleName("warn-style");
                        statusImg.setStyleName("warn-style-icon");
                        break;
                    default:
                        statusLabel.setText("");
                        statusLabel.setStyleName("blank-style");
                        statusImg.setStyleName("blank-style");
                        break;
                }

                importModeListBox.setEnabled(true);
                importButton.setEnabled(true);
            }
        });
        // Add a start handler which will disable the UI until the upload finishes
        uploader.addOnStartUploadHandler(new IUploader.OnStartUploaderHandler() {

            boolean isShwon = false;

            public void onStart(IUploader uploader) {
                if (uploader.getStatus() == IUploadStatus.Status.INPROGRESS) {
                    statusLabel.setText("Process in progress...");
                    statusLabel.setStyleName("progress-style");
                    statusImg.setStyleName("progress-style-icon");
                    importModeListBox.setEnabled(false);
                    importButton.setEnabled(false);
                    if (!isShwon) {
                        statusPanel.setStyleName("status-panel");
                        statusPanel.setSize("380px", "0px");
                        absolutePanel.add(statusPanel, 10, 120);

                        Timer t = new Timer() {

                            int dx = 5;
                            int height = 0;

                            public void run() {
                                height += dx;
                                statusPanel.setHeight(height + "px");
                                if (height >= 45) {
                                    cancel(); // Stop the timer
                                }
                            }
                        };

                        // Schedule the timer to run once in 100 milliseconds.
                        t.scheduleRepeating(100);
                        isShwon = true;
                    }
                }
            }
        });
        // accept only zip files
        uploader.setValidExtensions("zip");
        // You can add customized parameters to servlet call
        uploader.setServletPath(UPLOAD_ACTION_URL + "?pc=" + getPortalContainerName());

        importModeListBox.setTitle("The import mode to use during import.");
        importModeListBox.addChangeHandler(new ChangeHandler() {
            @Override
            public void onChange(ChangeEvent changeEvent) {
                String url = UPLOAD_ACTION_URL + "?pc=" + getPortalContainerName() + "&importMode="
                        + importModeListBox.getValue(importModeListBox.getSelectedIndex());
                uploader.setServletPath(url);
            }
        });

        absolutePanel.add(importModeLabel, 10, 88);
        absolutePanel.add(importModeListBox, 95, 84);
        Button closeButton = new Button("Close", new ClickHandler() {

            public void onClick(ClickEvent event) {
                dialogBox.hide();
            }
        });
        absolutePanel.add(closeButton, 343, 188);

        statusImg.setStyleName("progress-style-icon");
        statusPanel.add(statusImg, 10, 10);
        statusImg.setSize("50px", "30px");

        statusPanel.add(statusLabel, 60, 15);
        statusLabel.setSize("300px", "25px");

        importButton.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {

                uploader.submit();
            }
        });
        importButton.setEnabled(false);
        absolutePanel.add(importButton, 10, 188);
View Full Code Here

TOP

Related Classes of gwtupload.client.MultiUploader

Copyright © 2018 www.massapicom. 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.