diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:33:57 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:33:57 +0000 |
commit | be87bc6674daeec3a58931775f5b0d7c9cd71709 (patch) | |
tree | 5dfd911e1b8ff56e7b98b79f76d5a7ff3e35a743 /pdf-over-gui | |
parent | 0a6428b4339ee52dbfc38040217fcc87742d9f88 (diff) | |
download | mocca-be87bc6674daeec3a58931775f5b0d7c9cd71709.tar.gz mocca-be87bc6674daeec3a58931775f5b0d7c9cd71709.tar.bz2 mocca-be87bc6674daeec3a58931775f5b0d7c9cd71709.zip |
Allow error messages in tan state
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@384 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui')
3 files changed, 17 insertions, 7 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java index 8ae6aacd..953a898d 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java @@ -63,13 +63,10 @@ public class MobileBKUEnterTANComposite extends StateComposite { @Override public void widgetSelected(SelectionEvent e) { - if(!MobileBKUEnterTANComposite.this.btn_ok.getEnabled()) { return; } - - - + String tan = MobileBKUEnterTANComposite.this.txt_tan.getText(); tan = tan.trim(); @@ -153,6 +150,19 @@ public class MobileBKUEnterTANComposite extends StateComposite { } /** + * Set an error message + * @param errorMessage the error message + */ + public void setErrorMessage(String errorMessage) { + if (errorMessage == null) + this.lblTries.setText(""); //$NON-NLS-1$ + else + this.lblTries.setText( + Messages.getString("error.Title") + ": " + errorMessage); //$NON-NLS-1$ //$NON-NLS-2$ + } + + + /** * Sets the message * * @param msg @@ -423,5 +433,4 @@ public class MobileBKUEnterTANComposite extends StateComposite { .getString("tanEnter.ReferenceValue")); //$NON-NLS-1$ this.lblTan.setText(Messages.getString("tanEnter.TAN")); //$NON-NLS-1$ } - } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java index 671c670b..09dc56c2 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java @@ -289,13 +289,13 @@ public class MobileBKUState extends State { } else { tan.setRefVal(mobileStatus.getRefVal()); tan.setSignatureData(mobileStatus.getSignatureDataURL()); - + tan.setErrorMessage(mobileStatus.getErrorMessage()); if (mobileStatus.getTanTries() < mobileStatus.getMaxTanTries() && mobileStatus.getTanTries() > 0) { // show warning message x tries left! + // overrides error message tan.setTries(mobileStatus.getTanTries()); - } tan.enableButton(); this.stateMachine.getGUIProvider().display(tan); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java index 64f63b46..dcab0641 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java @@ -178,6 +178,7 @@ public class ATrustHandler extends MobileBKUHandler { */ @Override public void handleTANResponse(String responseData) { + getStatus().setErrorMessage(null); if (responseData.contains("sl:CreateXMLSignatureResponse xmlns:sl")) { //$NON-NLS-1$ // success !! |