From 699e71e76b15081baf746c6ce9c9144f7e5f1ff9 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Mon, 30 Sep 2013 10:11:28 -0400 Subject: [PATCH] Trim trailing whitespace and organize imports --- src/main/java/com/gitblit/authority/NewClientCertificateDialog.java | 48 +++++++++++++++++++++++++----------------------- 1 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/gitblit/authority/NewClientCertificateDialog.java b/src/main/java/com/gitblit/authority/NewClientCertificateDialog.java index 3d21439..3d8ea7e 100644 --- a/src/main/java/com/gitblit/authority/NewClientCertificateDialog.java +++ b/src/main/java/com/gitblit/authority/NewClientCertificateDialog.java @@ -45,7 +45,7 @@ public class NewClientCertificateDialog extends JDialog { private static final long serialVersionUID = 1L; - + JDateChooser expirationDate; JPasswordField pw1; JPasswordField pw2; @@ -55,47 +55,48 @@ public NewClientCertificateDialog(Frame owner, String displayname, Date defaultExpiration, boolean allowEmail) { super(owner); - + setTitle(Translation.get("gb.newCertificate")); - - JPanel content = new JPanel(new BorderLayout(Utils.MARGIN, Utils.MARGIN)) { + + JPanel content = new JPanel(new BorderLayout(Utils.MARGIN, Utils.MARGIN)) { private static final long serialVersionUID = 1L; @Override public Insets getInsets() { - + return Utils.INSETS; } }; - + expirationDate = new JDateChooser(defaultExpiration); pw1 = new JPasswordField(20); pw2 = new JPasswordField(20); hint = new JTextField(20); sendEmail = new JCheckBox(Translation.get("gb.sendEmail")); - + JPanel panel = new JPanel(new GridLayout(0, 2, Utils.MARGIN, Utils.MARGIN)); - + panel.add(new JLabel(Translation.get("gb.expires"))); panel.add(expirationDate); - + panel.add(new JLabel(Translation.get("gb.password"))); panel.add(pw1); panel.add(new JLabel(Translation.get("gb.confirmPassword"))); panel.add(pw2); - + panel.add(new JLabel(Translation.get("gb.passwordHint"))); panel.add(hint); - + if (allowEmail) { panel.add(new JLabel("")); panel.add(sendEmail); } - + JButton ok = new JButton(Translation.get("gb.ok")); ok.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (validateInputs()) { isCanceled = false; @@ -105,34 +106,35 @@ }); JButton cancel = new JButton(Translation.get("gb.cancel")); cancel.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { isCanceled = true; setVisible(false); } }); - + JPanel controls = new JPanel(); controls.add(ok); controls.add(cancel); - + JTextArea message = new JTextArea(Translation.get("gb.newClientCertificateMessage")); message.setLineWrap(true); message.setWrapStyleWord(true); message.setEditable(false); message.setRows(6); message.setPreferredSize(new Dimension(300, 100)); - + content.add(new JScrollPane(message), BorderLayout.CENTER); content.add(panel, BorderLayout.NORTH); content.add(controls, BorderLayout.SOUTH); - + getContentPane().add(new HeaderPanel(Translation.get("gb.newCertificate") + " (" + displayname + ")", "rosette_16x16.png"), BorderLayout.NORTH); getContentPane().add(content, BorderLayout.CENTER); pack(); - + setLocationRelativeTo(owner); } - + private boolean validateInputs() { if (getExpiration().getTime() < System.currentTimeMillis()) { // expires before now @@ -154,23 +156,23 @@ } return true; } - + public String getPassword() { return new String(pw1.getPassword()); } - + public String getPasswordHint() { return hint.getText(); } - + public Date getExpiration() { return expirationDate.getDate(); } - + public boolean sendEmail() { return sendEmail.isSelected(); } - + public boolean isCanceled() { return isCanceled; } -- Gitblit v1.9.1