diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-03-25 14:59:41 +0100 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-03-25 14:59:41 +0100 |
commit | 37484b1c390a8cf5ffacd654483bc62d87a4997c (patch) | |
tree | 031d94bf64585460207a0a3362f72db14a1089e1 /pdf-over-gui/src | |
parent | 9599037d1e0b2723e9d4b4864ce8acd90950c48f (diff) | |
download | pdf-over-37484b1c390a8cf5ffacd654483bc62d87a4997c.tar.gz pdf-over-37484b1c390a8cf5ffacd654483bc62d87a4997c.tar.bz2 pdf-over-37484b1c390a8cf5ffacd654483bc62d87a4997c.zip |
standardize yes/no/cancel between different kinds of signature placeholders
Diffstat (limited to 'pdf-over-gui/src')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java index fdbc2580..dab181af 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java @@ -170,12 +170,13 @@ public class OpenState extends State { // create a dialog with ok and cancel buttons and a question icon MessageBox dialog = new MessageBox(getStateMachine().getGUIProvider().getMainShell(), - SWT.ICON_QUESTION | SWT.YES | SWT.NO); + SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL); dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); //$NON-NLS-1$ dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); //$NON-NLS-1$ // open dialog and await user selection - if (SWT.YES == dialog.open()) { + int result = dialog.open(); + if (result == SWT.YES) { // if the user chooses to use the signature placeholder // - fill the position information so that we skip to @@ -189,8 +190,11 @@ public class OpenState extends State { getStateMachine().getStatus().setSearchForPlaceholderSignature(true); - } else { + } else if (result == SWT.NO) { getStateMachine().getStatus().setSearchForPlaceholderSignature(false); + } else { + status.setDocument(null); + return; } // TODO: why does this use a different logic (via PositioningState) than the signature placeholders? } |