/** * Displays the dialog box and waits until the user applies their changes or cancels the dialog. * <p> * If the user elects to apply their changes, this method returns the updated ACL information. * If the user cancels the dialog, this method returns null. * * @param owner the Frame within which this dialog will be displayed and centered * @param s3Items an array of {@link S3Bucket} or {@link S3Object}s to which ACL change will be applied * @param accessControlList the original ACL settings for the S3Bucket or S3Objects provided * @return the update ACL settings if the user applies changes, null if the dialog is cancelled. */ public static AccessControlList showDialog(Frame owner, BaseStorageItem[] s3Items, AccessControlList accessControlList, HyperlinkActivatedListener hyperlinkListener) { if (accessControlDialog == null) { accessControlDialog = new AccessControlDialog(owner, hyperlinkListener); } accessControlDialog.initData(s3Items, accessControlList); accessControlDialog.setVisible(true); return accessControlDialog.getUpdatedAccessControlList(); }
/** * Creates a modal dialog box with a title. * * @param owner the frame within which this dialog will be displayed and centred. */ protected AccessControlDialog(Frame owner, HyperlinkActivatedListener hyperlinkListener) { super(owner, "Update Access Control List Permissions", true); this.hyperlinkListener = hyperlinkListener; initGui(); }
this.setResizable(true); this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); this.getRootPane().setDefaultButton(okButton); 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 = 4173433313456104263L; new GridBagConstraints(0, ++row, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); this.getContentPane().add(container); this.pack(); this.setSize(new Dimension(700, 500)); this.setLocationRelativeTo(this.getOwner());
this.setResizable(true); this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); this.getRootPane().setDefaultButton(okButton); 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 = 4173433313456104263L; new GridBagConstraints(0, ++row, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); this.getContentPane().add(container); this.pack(); this.setSize(new Dimension(700, 500)); this.setLocationRelativeTo(this.getOwner());
/** * Displays the dialog box and waits until the user applies their changes or cancels the dialog. * <p> * If the user elects to apply their changes, this method returns the updated ACL information. * If the user cancels the dialog, this method returns null. * * @param owner the Frame within which this dialog will be displayed and centered * @param s3Items an array of {@link S3Bucket} or {@link S3Object}s to which ACL change will be applied * @param accessControlList the original ACL settings for the S3Bucket or S3Objects provided * @return the update ACL settings if the user applies changes, null if the dialog is cancelled. */ public static AccessControlList showDialog(Frame owner, BaseStorageItem[] s3Items, AccessControlList accessControlList, HyperlinkActivatedListener hyperlinkListener) { if (accessControlDialog == null) { accessControlDialog = new AccessControlDialog(owner, hyperlinkListener); } accessControlDialog.initData(s3Items, accessControlList); accessControlDialog.setVisible(true); return accessControlDialog.getUpdatedAccessControlList(); }
/** * Creates a modal dialog box with a title. * * @param owner the frame within which this dialog will be displayed and centred. */ protected AccessControlDialog(Frame owner, HyperlinkActivatedListener hyperlinkListener) { super(owner, "Update Access Control List Permissions", true); this.hyperlinkListener = hyperlinkListener; initGui(); }