Package org.jets3t.gui

Examples of org.jets3t.gui.ProgressDialog


    private void startProgressDialog(final String statusMessage, final String detailsText,
        final int minTaskValue, final int maxTaskValue, final String cancelButtonText,
        final CancelEventTrigger cancelEventListener)
    {
        if (this.progressDialog == null) {
            this.progressDialog = new ProgressDialog(this.ownerFrame, "Please wait...", null);
        }

        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                progressDialog.startDialog(statusMessage, detailsText, minTaskValue, maxTaskValue,
View Full Code Here


    private void startProgressDialog(final String statusMessage, final String detailsText,
        final int minTaskValue, final int maxTaskValue, final String cancelButtonText,
        final CancelEventTrigger cancelEventListener)
    {
        if (this.progressDialog == null) {
            this.progressDialog = new ProgressDialog(
                this.ownerFrame, "Please wait...", cockpitLiteProperties.getProperties());
        }
       
        this.getContentPane().setCursor(new Cursor(Cursor.WAIT_CURSOR));
       
View Full Code Here

            log.error(message, e);
            ErrorDialog.showDialog(this, hyperlinkListener, message, e);
            return;
        }

        final ProgressDialog progressDialog = new ProgressDialog(
            ownerFrame, "Retrieving credentials", null);
        final StartupDialog myself = this;

        (new Thread(new Runnable() {
            public void run() {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        progressDialog.startDialog("Downloading your credentials", "", 0, 0, null, null);
                    }
                 });

                StorageObject encryptedCredentialsObject = null;

                try {
                    credentials = null;
                    StorageService service = getStorageService();
                    encryptedCredentialsObject = service.getObject(
                        bucketName[0], credentialObjectKey[0]);
                } catch (ServiceException e) {
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });

                    String errorMessage = "<html><center>Unable to find your credentials online"
                        + "<br><br>Please check your passphrase and password</center></html>";
                    log.error(errorMessage, e);
                    ErrorDialog.showDialog(myself, hyperlinkListener, errorMessage, null);
                    return;
                }

                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        progressDialog.updateDialog("Decrypting your credentials", null, 0);
                    }
                 });

                try {
                    if (targetS3.isSelected()) {
                        myself.credentials = AWSCredentials.load(password,
                            new BufferedInputStream(encryptedCredentialsObject.getDataInputStream()));
                    } else {
                        myself.credentials = GSCredentials.load(password,
                            new BufferedInputStream(encryptedCredentialsObject.getDataInputStream()));
                    }

                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });
                    myself.setVisible(false);
                } catch (ServiceException e) {
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });

                    String errorMessage =
                        "<html><center>Unable to load your online credentials"
View Full Code Here

            log.error(message, e);
            ErrorDialog.showDialog(this, hyperlinkListener, message, e);
            return;
        }

        final ProgressDialog progressDialog = new ProgressDialog(
            ownerFrame, "Storing credentials", null);
        final StartupDialog myself = this;

        (new Thread(new Runnable() {
            public void run() {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        progressDialog.startDialog("Uploading your credentials", null, 0, 0, null, null);
                    }
                 });

                try {
                    StorageObject encryptedCredentialsObject =
                        new StorageObject(credentialObjectKey[0]);
                    encryptedCredentialsObject.setDataInputStream(bais[0]);
                    encryptedCredentialsObject.setAcl(AccessControlList.REST_CANNED_PUBLIC_READ);

                    // Store credentials
                    StorageService service = getStorageService();
                    service.createBucket(bucketName[0]);
                    service.putObject(bucketName[0], encryptedCredentialsObject);

                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });

                    JOptionPane.showMessageDialog(ownerFrame,
                        "Your credentials have been stored online"
                        + "\n\nBucket name: " + bucketName[0]
                        + "\nObject key: " + credentialObjectKey[0]);
                } catch (ServiceException e) {
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });

                    String message = "Unable to store your credentials online";
                    log.error(message, e);
View Full Code Here

                        (S3BucketLoggingStatus) loggingStatusMap.get(bucketName);
                    displayBucketLoggingStatus(loggingStatus);
                } else {
                    (new Thread() {
                        public void run() {
                            final ProgressDialog progressDialog =
                                new ProgressDialog(ownerFrame, "Bucket Logging", null);

                            SwingUtilities.invokeLater(new Runnable() {
                                public void run() {
                                    progressDialog.startDialog("Retrieving bucket logging status",
                                        null, 0, 0, null, null);
                                }
                             });

                            try {
                                S3BucketLoggingStatus loggingStatus =
                                    s3Service.getBucketLoggingStatus(bucketName);
                                loggingStatusMap.put(bucketName, loggingStatus);
                                displayBucketLoggingStatus(loggingStatus);
                            } catch (Exception e) {
                                SwingUtilities.invokeLater(new Runnable() {
                                    public void run() {
                                        progressDialog.stopDialog();
                                    }
                                 });

                                ErrorDialog.showDialog(ownerFrame, null,
                                    "Unable to retrieve bucket logging status for " + bucketName, e);
                            }
                            SwingUtilities.invokeLater(new Runnable() {
                                public void run() {
                                    progressDialog.stopDialog();
                                }
                             });
                        }
                    }).start();
                }
            }
        } else if (event.getSource().equals(loggedToBucketComboBox)) {
            if (!loggedToBucketComboBox.isEnabled()) {
                // Ignore this event, it is internally generated.
                return;
            }

            final String loggedBucketName = (String) loggedBucketComboBox.getSelectedItem();
            final String[] loggedToBucketName = new String[1];
            final String[] loggingFilePrefix = new String[1];

            if (loggedToBucketComboBox.getSelectedIndex() == 0) {
                // Logging is being disabled, leave values as null.
            } else {
                if (prefixTextField.getText().length() == 0) {
                    ErrorDialog.showDialog(ownerFrame, null,
                        "A log file name prefix must be provided to log buckets", null);
                    loggedToBucketComboBox.setSelectedIndex(0);
                    return;
                }

                loggedToBucketName[0] = (String) loggedToBucketComboBox.getSelectedItem();
                loggingFilePrefix[0] = prefixTextField.getText();
            }

            (new Thread(new Runnable() {
                public void run() {
                    final ProgressDialog progressDialog =
                        new ProgressDialog(ownerFrame, "Bucket Logging", null);
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.startDialog("Setting bucket logging status",
                                null, 0, 0, null, null);
                        }
                     });

                    try {
                        S3BucketLoggingStatus loggingStatus =
                            new S3BucketLoggingStatus(loggedToBucketName[0], loggingFilePrefix[0]);
                        s3Service.setBucketLoggingStatus(loggedBucketName, loggingStatus, true);

                        loggingStatusMap.put(loggedBucketName, loggingStatus);
                    } catch (Exception e) {
                        SwingUtilities.invokeLater(new Runnable() {
                            public void run() {
                                progressDialog.stopDialog();
                            }
                         });
                        ErrorDialog.showDialog(ownerFrame, null,
                            "Unable to set bucket logging status for " + loggedBucketName, e);
                    }
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });
                };
            })).start();
        }
View Full Code Here

    private void startProgressDialog(final String statusMessage, final String detailsText,
        final int minTaskValue, final int maxTaskValue, final String cancelButtonText,
        final CancelEventTrigger cancelEventListener)
    {
        if (this.progressDialog == null) {
            this.progressDialog = new ProgressDialog(this.ownerFrame, "Please wait...", null);
        }

        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                progressDialog.startDialog(statusMessage, detailsText, minTaskValue, maxTaskValue,
View Full Code Here

    private void startProgressDialog(final String statusMessage, final String detailsText,
        final int minTaskValue, final int maxTaskValue, final String cancelButtonText,
        final CancelEventTrigger cancelEventListener)
    {
        if (this.progressDialog == null) {
            this.progressDialog = new ProgressDialog(
                this.ownerFrame, "Please wait...", cockpitLiteProperties.getProperties());
        }

        this.getContentPane().setCursor(new Cursor(Cursor.WAIT_CURSOR));
View Full Code Here

TOP

Related Classes of org.jets3t.gui.ProgressDialog

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.