Package org.jets3t.gui

Examples of org.jets3t.gui.ProgressDialog


                        (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);
        }
       
        this.getContentPane().setCursor(new Cursor(Cursor.WAIT_CURSOR));
       
        SwingUtilities.invokeLater(new Runnable() {
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

            log.error(message, e);
            ErrorDialog.showDialog(this, hyperlinkListener, message, e);
            return;
        }
       
        final ProgressDialog progressDialog = new ProgressDialog(
            ownerFrame, "Retrieving AWS Credentials", null);
        final StartupDialog myself = this;
           
        (new Thread(new Runnable() {
            public void run() {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        progressDialog.startDialog("Downloading your AWS Credentials", "", 0, 0, null, null);
                    }
                 });
               
                S3Object encryptedCredentialsObject = null;

                try {
                    S3Service s3Service = new RestS3Service(null);       
                    encryptedCredentialsObject = s3Service.getObject(
                        new S3Bucket(bucketName[0]), credentialObjectKey[0]);
                } catch (S3ServiceException e) {
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });

                    String errorMessage = "<html><center>Unable to find your AWS Credentials in S3"
                        + "<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 AWS Credentials", null, 0);
                    }
                 });
               
                try {
                    myself.awsCredentials = AWSCredentials.load(password,
                        new BufferedInputStream(encryptedCredentialsObject.getDataInputStream()));
                   
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });
                    myself.setVisible(false);
                } catch (S3ServiceException e) {
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });
                   
                    String errorMessage =
                        "<html><center>Unable to load your AWS Credentials from S3: "
View Full Code Here

            log.error(message, e);
            ErrorDialog.showDialog(this, hyperlinkListener, message, e);
            return;
        }
       
        final ProgressDialog progressDialog = new ProgressDialog(
            ownerFrame, "Storing AWS Credentials", null);           
        final StartupDialog myself = this;

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

                try {
                    S3Bucket bucket = new S3Bucket(bucketName[0]);
                    S3Object encryptedCredentialsObject = new S3Object(credentialObjectKey[0]);       
                    encryptedCredentialsObject.setDataInputStream(bais[0]);
                    encryptedCredentialsObject.setAcl(AccessControlList.REST_CANNED_PUBLIC_READ);
                   
                    // Store credentials
                    S3Service s3Service = new RestS3Service(awsCredentials);
                    s3Service.createBucket(bucketName[0]);           
                    s3Service.putObject(bucket, encryptedCredentialsObject);
       
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();                   
                        }
                     });

                    JOptionPane.showMessageDialog(ownerFrame, "Your AWS Credentials have been stored in your " +
                        "S3 account\n\nBucket name: " + bucketName[0] + "\nObject key: " + credentialObjectKey[0]);
                    actionModeComboBox.setSelectedIndex(ACTION_MODE_LOG_IN);
                   
                } catch (S3ServiceException e) {
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();                   
                        }
                     });

                    String message = "Unable to store your AWS Credentials in S3";
                    log.error(message, e);
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 AWS Credentials", null);
        final StartupDialog myself = this;
           
        (new Thread(new Runnable() {
            public void run() {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        progressDialog.startDialog("Downloading your AWS Credentials", "", 0, 0, null, null);
                    }
                 });
               
                S3Object encryptedCredentialsObject = null;

                try {
                    S3Service s3Service = new RestS3Service(null);       
                    encryptedCredentialsObject = s3Service.getObject(
                        new S3Bucket(bucketName[0]), credentialObjectKey[0]);
                } catch (S3ServiceException e) {
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });

                    String errorMessage = "<html><center>Unable to find your AWS Credentials in S3"
                        + "<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 AWS Credentials", null, 0);
                    }
                 });
               
                try {
                    myself.awsCredentials = AWSCredentials.load(password,
                        new BufferedInputStream(encryptedCredentialsObject.getDataInputStream()));
                   
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });
                    myself.setVisible(false);
                } catch (S3ServiceException e) {
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();
                        }
                     });
                   
                    String errorMessage =
                        "<html><center>Unable to load your AWS Credentials from S3: "
View Full Code Here

            log.error(message, e);
            ErrorDialog.showDialog(this, hyperlinkListener, message, e);
            return;
        }
       
        final ProgressDialog progressDialog = new ProgressDialog(
            ownerFrame, "Storing AWS Credentials", null);           
        final StartupDialog myself = this;

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

                try {
                    S3Bucket bucket = new S3Bucket(bucketName[0]);
                    S3Object encryptedCredentialsObject = new S3Object(credentialObjectKey[0]);       
                    encryptedCredentialsObject.setDataInputStream(bais[0]);
                    encryptedCredentialsObject.setAcl(AccessControlList.REST_CANNED_PUBLIC_READ);
                   
                    // Store credentials
                    S3Service s3Service = new RestS3Service(awsCredentials);
                    s3Service.createBucket(bucketName[0]);           
                    s3Service.putObject(bucket, encryptedCredentialsObject);
       
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();                   
                        }
                     });

                    JOptionPane.showMessageDialog(ownerFrame, "Your AWS Credentials have been stored in your " +
                        "S3 account\n\nBucket name: " + bucketName[0] + "\nObject key: " + credentialObjectKey[0]);
                } catch (S3ServiceException e) {
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            progressDialog.stopDialog();                   
                        }
                     });

                    String message = "Unable to store your AWS Credentials in S3";
                    log.error(message, e);
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.