projects
/
jSite.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Set the EarlyEncode flag on insert."
[jSite.git]
/
src
/
de
/
todesbaum
/
jsite
/
application
/
KeyDialog.java
diff --git
a/src/de/todesbaum/jsite/application/KeyDialog.java
b/src/de/todesbaum/jsite/application/KeyDialog.java
index
2e30829
..
5aba000
100644
(file)
--- a/
src/de/todesbaum/jsite/application/KeyDialog.java
+++ b/
src/de/todesbaum/jsite/application/KeyDialog.java
@@
-1,5
+1,5
@@
/*
/*
- * jSite - KeyDialog.java - Copyright © 2010 David Roden
+ * jSite - KeyDialog.java - Copyright © 2010
–2011
David Roden
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-81,6
+81,9
@@
public class KeyDialog extends JDialog {
/** The text field for the public key. */
private JTextField publicKeyTextField;
/** The text field for the public key. */
private JTextField publicKeyTextField;
+ /** Whether the dialog was cancelled. */
+ private boolean cancelled;
+
/**
* Creates a new key dialog.
*
/**
* Creates a new key dialog.
*
@@
-108,6
+111,15
@@
public class KeyDialog extends JDialog {
//
/**
//
/**
+ * Returns whether the dialog was cancelled.
+ *
+ * @return {@code true} if the dialog was cancelled, {@code false} otherwise
+ */
+ public boolean wasCancelled() {
+ return cancelled;
+ }
+
+ /**
* Returns the public key.
*
* @return The public key
* Returns the public key.
*
* @return The public key
@@
-173,7
+185,6
@@
public class KeyDialog extends JDialog {
private void createActions() {
okAction = new AbstractAction(I18n.getMessage("jsite.general.ok")) {
private void createActions() {
okAction = new AbstractAction(I18n.getMessage("jsite.general.ok")) {
- @Override
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionOk();
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionOk();
@@
-184,7
+195,6
@@
public class KeyDialog extends JDialog {
cancelAction = new AbstractAction(I18n.getMessage("jsite.general.cancel")) {
cancelAction = new AbstractAction(I18n.getMessage("jsite.general.cancel")) {
- @Override
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionCancel();
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionCancel();
@@
-195,7
+205,6
@@
public class KeyDialog extends JDialog {
generateAction = new AbstractAction(I18n.getMessage("jsite.key-dialog.button.generate")) {
generateAction = new AbstractAction(I18n.getMessage("jsite.key-dialog.button.generate")) {
- @Override
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionGenerate();
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent actionEvent) {
actionGenerate();
@@
-252,7
+261,6
@@
public class KeyDialog extends JDialog {
I18nContainer.getInstance().registerRunnable(new Runnable() {
I18nContainer.getInstance().registerRunnable(new Runnable() {
- @Override
public void run() {
keysLabel.setText(I18n.getMessage("jsite.key-dialog.label.keys"));
privateKeyLabel.setText(I18n.getMessage("jsite.key-dialog.label.private-key"));
public void run() {
keysLabel.setText(I18n.getMessage("jsite.key-dialog.label.keys"));
privateKeyLabel.setText(I18n.getMessage("jsite.key-dialog.label.private-key"));
@@
-276,6
+284,7
@@
public class KeyDialog extends JDialog {
private void actionOk() {
publicKey = publicKeyTextField.getText();
privateKey = privateKeyTextField.getText();
private void actionOk() {
publicKey = publicKeyTextField.getText();
privateKey = privateKeyTextField.getText();
+ cancelled = false;
setVisible(false);
}
setVisible(false);
}
@@
-283,6
+292,7
@@
public class KeyDialog extends JDialog {
* Quits the dialog, discarding all changes.
*/
private void actionCancel() {
* Quits the dialog, discarding all changes.
*/
private void actionCancel() {
+ cancelled = true;
setVisible(false);
}
setVisible(false);
}