| | |
| | | JCheckBox sendEmail;
|
| | | boolean isCanceled = true;
|
| | |
|
| | | public NewClientCertificateDialog(Frame owner, String displayname, Date defaultExpiration) {
|
| | | public NewClientCertificateDialog(Frame owner, String displayname, Date defaultExpiration, boolean allowEmail) {
|
| | | super(owner);
|
| | |
|
| | | setTitle(Translation.get("gb.newCertificate"));
|
| | |
|
| | | JPanel content = new JPanel(new BorderLayout(5, 5)) { |
| | | JPanel content = new JPanel(new BorderLayout(Utils.MARGIN, Utils.MARGIN)) { |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | |
| | | hint = new JTextField(20);
|
| | | sendEmail = new JCheckBox(Translation.get("gb.sendEmail"));
|
| | |
|
| | | JPanel panel = new JPanel(new GridLayout(0, 2, 5, 5));
|
| | | 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.passwordHint")));
|
| | | panel.add(hint);
|
| | |
|
| | | if (allowEmail) {
|
| | | panel.add(new JLabel(""));
|
| | | panel.add(sendEmail);
|
| | | }
|
| | |
|
| | | content.add(panel, BorderLayout.CENTER);
|
| | |
|
| | |
| | | private boolean validateInputs() {
|
| | | if (getExpiration().getTime() < System.currentTimeMillis()) {
|
| | | // expires before now
|
| | | JOptionPane.showMessageDialog(this, Translation.get("gb.invalidExpiraitonDate"),
|
| | | JOptionPane.showMessageDialog(this, Translation.get("gb.invalidExpirationDate"),
|
| | | Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);
|
| | | return false;
|
| | | }
|