/** * Dialog box for displaying and modifying the logging status of buckets. * * @param ownerFrame * the frame that will own the dialog. * @param s3Service * an S3 Service that will be used to query and update the logging status of buckets. This * service must be initialised with the necessary AWS credentials to perform the logging status * change operations. * @param bucketNames * the names of buckets in the user's S3 account. * @param hyperlinkListener * the listener that will act on any hyperlink events triggered by the user clicking on HTTP links. */ public static void showDialog(Frame ownerFrame, S3Service s3Service, String[] bucketNames, HyperlinkActivatedListener hyperlinkListener) { BucketLoggingDialog dialog = new BucketLoggingDialog( ownerFrame, s3Service, bucketNames, hyperlinkListener); dialog.setVisible(true); dialog.dispose(); }
this.getRootPane().setDefaultButton(finishedButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { private static final long serialVersionUID = -6225706489569112809L; 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsDefault, 0, 0)); this.getContentPane().setLayout(new GridBagLayout()); this.getContentPane().add(panel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); this.pack(); this.setResizable(false); this.setLocationRelativeTo(ownerFrame);
this.setVisible(false); } else if (event.getSource().equals(loggedBucketComboBox)) { prefixTextField.setEnabled(false); S3BucketLoggingStatus loggingStatus = (S3BucketLoggingStatus) loggingStatusMap.get(bucketName); displayBucketLoggingStatus(loggingStatus); } else { (new Thread() {
public void actionPerformed(ActionEvent actionEvent) { setVisible(false); } });
private void displayBucketLoggingStatus(S3BucketLoggingStatus loggingStatus) { if (loggingStatus.isLoggingEnabled()) { loggedToBucketComboBox.setSelectedIndex( findBucketIndexByName(loggingStatus.getTargetBucketName())); prefixTextField.setText(loggingStatus.getLogfilePrefix()); } else { loggedToBucketComboBox.setSelectedIndex(0); if (loggedBucketComboBox.getSelectedIndex() != 0) { prefixTextField.setText(loggedBucketComboBox.getSelectedItem() + "."); } else { prefixTextField.setText(""); } } prefixTextField.setEnabled(true); loggedToBucketComboBox.setEnabled(true); }
this.getRootPane().setDefaultButton(finishedButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { private static final long serialVersionUID = -6225706489569112809L; 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsDefault, 0, 0)); this.getContentPane().setLayout(new GridBagLayout()); this.getContentPane().add(panel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); this.pack(); this.setResizable(false); this.setLocationRelativeTo(ownerFrame);
this.setVisible(false); } else if (event.getSource().equals(loggedBucketComboBox)) { prefixTextField.setEnabled(false); S3BucketLoggingStatus loggingStatus = (S3BucketLoggingStatus) loggingStatusMap.get(bucketName); displayBucketLoggingStatus(loggingStatus); } else { (new Thread() {
public void actionPerformed(ActionEvent actionEvent) { setVisible(false); } });
private void displayBucketLoggingStatus(S3BucketLoggingStatus loggingStatus) { if (loggingStatus.isLoggingEnabled()) { loggedToBucketComboBox.setSelectedIndex( findBucketIndexByName(loggingStatus.getTargetBucketName())); prefixTextField.setText(loggingStatus.getLogfilePrefix()); } else { loggedToBucketComboBox.setSelectedIndex(0); if (loggedBucketComboBox.getSelectedIndex() != 0) { prefixTextField.setText(loggedBucketComboBox.getSelectedItem() + "."); } else { prefixTextField.setText(""); } } prefixTextField.setEnabled(true); loggedToBucketComboBox.setEnabled(true); }
/** * Dialog box for displaying and modifying the logging status of buckets. * * @param ownerFrame * the frame that will own the dialog. * @param s3Service * an S3 Service that will be used to query and update the logging status of buckets. This * service must be initialised with the necessary AWS credentials to perform the logging status * change operations. * @param bucketNames * the names of buckets in the user's S3 account. * @param hyperlinkListener * the listener that will act on any hyperlink events triggered by the user clicking on HTTP links. */ public static void showDialog(Frame ownerFrame, S3Service s3Service, String[] bucketNames, HyperlinkActivatedListener hyperlinkListener) { BucketLoggingDialog dialog = new BucketLoggingDialog( ownerFrame, s3Service, bucketNames, hyperlinkListener); dialog.setVisible(true); dialog.dispose(); }