diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2012-11-07 10:02:36 +0100 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2012-11-07 10:02:55 +0100 |
commit | ca6544acdadbc42dbbc9be68718782eeb815b0ad (patch) | |
tree | 0671736d0385e87df362c446ecc39ca7e10528b5 /trunk/pdf-over-gui/src/main/java/at/asit/pdfover | |
parent | fd2a1aacd3841b84dcad14346aa7ce1715607ad0 (diff) | |
download | pdf-over-ca6544acdadbc42dbbc9be68718782eeb815b0ad.tar.gz pdf-over-ca6544acdadbc42dbbc9be68718782eeb815b0ad.tar.bz2 pdf-over-ca6544acdadbc42dbbc9be68718782eeb815b0ad.zip |
+ localized error "This may not be a PDF File"
Diffstat (limited to 'trunk/pdf-over-gui/src/main/java/at/asit/pdfover')
2 files changed, 8 insertions, 3 deletions
diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java index d612f3c9..c7e1b7b7 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java @@ -173,8 +173,13 @@ public class PositioningComposite extends StateComposite { .map(FileChannel.MapMode.READ_ONLY, 0, chan.size()); chan.close(); rafile.close(); - - this.pdf = new PDFFile(buf); + try + { + this.pdf = new PDFFile(buf); + } + catch (IOException e) { + throw new IOException(Messages.getString("error.MayNotBeAPDF"), e); //$NON-NLS-1$ + } if (this.viewer == null) { this.viewer = new SignaturePanel(this.pdf); this.frame.add(this.viewer); diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java index 44513806..d877cdcf 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java @@ -101,7 +101,7 @@ public class PositioningState extends State { log.error("Failed to display PDF document", e); //$NON-NLS-1$ ErrorDialog dialog = new ErrorDialog( this.stateMachine.getGUIProvider().getMainShell(), - e.getMessage(), ERROR_BUTTONS.RETRY_CANCEL); + e.getLocalizedMessage(), ERROR_BUTTONS.RETRY_CANCEL); if(dialog.open() == SWT.RETRY) { this.stateMachine.update(); } else { |