diff options
Diffstat (limited to 'pdf-over-gui')
6 files changed, 43 insertions, 30 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 833d2670..fcd7084f 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 @@ -101,7 +101,7 @@ public class MobileBKUEnterTANComposite extends StateComposite { * @param tries */ public void setTries(int tries) { - this.lbl_tries.setText(tries + Messages.getString("tanEnter.tries")); //$NON-NLS-1$ + this.lbl_tries.setText(String.format(Messages.getString("tanEnter.tries"), tries)); //$NON-NLS-1$ } /** diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java index 7f73d0c8..a9ea31d2 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java @@ -214,7 +214,7 @@ public class OutputComposite extends StateComposite { if (OutputComposite.this.outputFile != null) { if (OutputComposite.this.outputFile.exists()) { - // Desktop supported check allready done in constructor + // Desktop supported check already done in constructor if (Desktop.isDesktopSupported()) { Desktop.getDesktop().open( OutputComposite.this.outputFile); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java index 5d32ec30..04b10d9c 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java @@ -854,7 +854,11 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite { if (portString == null || portString.trim().equals("")) { //$NON-NLS-1$ port = -1; } else { - port = Integer.parseInt(portString); + try { + port = Integer.parseInt(portString); + } catch (NumberFormatException e) { + throw new InvalidPortException(portString, e); + } } this.configurationContainer.setProxyPort(port); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java index 0657da7c..0d3306fa 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java @@ -34,7 +34,7 @@ public class InvalidEmblemFile extends PDFOverGUIException { * @param file */ public InvalidEmblemFile(final File file) { - super(file.getAbsolutePath() + Messages.getString("exception.InvalidEmblemFile")); //$NON-NLS-1$ + super(String.format(Messages.getString("exception.InvalidEmblemFile"), file.getAbsolutePath())); //$NON-NLS-1$ } /** @@ -43,6 +43,6 @@ public class InvalidEmblemFile extends PDFOverGUIException { * @param reason */ public InvalidEmblemFile(final File file, Throwable reason) { - super(file.getAbsolutePath() + Messages.getString("exception.InvalidEmblemFile"), reason); //$NON-NLS-1$ + super(String.format(Messages.getString("exception.InvalidEmblemFile"), file.getAbsolutePath()), reason); //$NON-NLS-1$ } } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java index 3a37d3a0..98b05c79 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java @@ -28,10 +28,19 @@ public class InvalidPortException extends PDFOverGUIException { /** - * Constructor - * @param port + * Constructor with an invalid port number + * @param port invalid port number */ public InvalidPortException(int port) { - super(port + Messages.getString("exception.InvalidPort") + 0xffff); //$NON-NLS-1$ + super(String.format(Messages.getString("exception.InvalidPort"), Integer.toString(port), 1, 0xffff)); //$NON-NLS-1$ + } + + /** + * Constructor with an invalid port string + * @param source InvalidNumberFormat exception + * @param portString invalid port string + */ + public InvalidPortException(String portString, Throwable source) { + super(String.format(Messages.getString("exception.InvalidPort"), portString, 1, 0xffff), source); //$NON-NLS-1$ } } diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties index 2904e9c4..733c4724 100644 --- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties @@ -1,13 +1,13 @@ #Eclipse messages class #Tue Oct 23 16:04:42 CEST 2012 -BKU.LOCAL=Local BKU -BKU.MOBILE=Mobile BKU +BKU.LOCAL=Local CCE +BKU.MOBILE=Mobile CCE BKU.NONE=no default BKUSelectionComposite.btnMobile.text=MOBILE TrustedSocketFactory.FailedToCreateSecureConnection=Failed to create secure network connection advanced_config.AutoPosition=Automatic positioning advanced_config.Signature_Title=Si&gnature -advanced_config.BKUSelection_Title=BKU Selection +advanced_config.BKUSelection_Title=CCE Selection advanced_config.OutputFolder=Default output folder: advanced_config.OutputFolder.Dialog=Select a folder advanced_config.OutputFolder.Dialog_Title=Select Output folder @@ -17,26 +17,26 @@ advanced_config.SigPHTransparencyMax=Opaque advanced_config.SigPHTransparencyMin=Invisible advanced_config.AutoPosition_ToolTip=Activate this option to automatically position the signature advanced_config.OutputFolder_ToolTip=Select the folder where the signed document will be saved automatically (clear this field to disable automatic saving) -advanced_config.BKUSelection_ToolTip=Select the default BKU to use during signature +advanced_config.BKUSelection_ToolTip=Select the default CCE to use during signature argument.error.output=is not a directory -argument.help.bku=Select the BKU to use values are: LOCAL, MOBILE (example: -b <option> +argument.help.bku=Select the CCE to use. Values are: LOCAL, MOBILE. Example: -b <option> argument.help.config=Defines which configuration file to use. Example: -c <config file> argument.help.emblem=Sets the signature logo file to use for the signature. Example: -e <emblem file> -argument.help.help=shows this help message +argument.help.help=Shows this help message argument.help.input=Sets the document to sign. Example: -i <input document> -argument.help.number=Sets the telephone number to use for mobile bku. Example: -n <number> +argument.help.number=Sets the telephone number to use for mobile CCE. Example: -n <number> argument.help.output=Sets the output folder to use. Example: -o <folder> -argument.help.password=Sets the password to use for mobile bku. Example: -p <password> +argument.help.password=Sets the password to use for mobile CCE. Example: -p <password> argument.help.proxyhost=Sets the proxy host to use. Example: -proxy <hostname/IP> argument.help.proxyport=Sets the proxy port to use. Example: -proxyport <port> argument.info.help=The following options are available: -argument.invalid.bku=BKU Argument invalid! Use: -argument.invalid.config=Configuration File Argument invalid! Use: +argument.invalid.bku=CCE argument invalid! Use: +argument.invalid.config=Configuration file argument invalid! Use: argument.invalid.emblem=Signature logo argument invalid! Use: argument.invalid.input=Document to sign argument invalid! Use: -argument.invalid.number=Phone Number Argument invalid! Use: +argument.invalid.number=Phone number argument invalid! Use: argument.invalid.output=Output folder argument invalid! Use: -argument.invalid.password=Mobile BKU password invalid! Use: +argument.invalid.password=Mobile CCE password invalid! Use: argument.invalid.proxyhost=Proxy host argument invalid! Use: argument.invalid.proxyport=Proxy port argument invalid! Use: bku_selection.card=&Card @@ -53,7 +53,7 @@ common.Save=&Save common.browse=&Browse common.open=Open config.Advanced=Ad&vanced -config.Simple=S&imple +config.Simple=Basi&c dataSourceSelection.DropLabel=Drag document here dataSourceSelection.DropLabel2=Or, if you prefer... dataSourceSelection.browse=&Browse for PDF on your computer @@ -64,10 +64,10 @@ error.FailedToLoadEmblem=Failed to load the signature logo error.FailedToSaveSettings=Failed to save configuration file! error.FileNotExist=File %s does not exist! error.Initialization=Initialization failed. Please check your configuration. -error.InvalidBKU=Invalid BKU selection. Please check. +error.InvalidBKU=Invalid CCE selection. Please check. error.InvalidPhoneNumber=Given phone number is invalid! Example: +43664123456789 error.InvalidSettings=Invalid settings are still present. Please check your input. -error.LocalBKU=Please check if a local BKU is running +error.LocalBKU=Please check if a local CCE is running error.PrepareDocument=Failed to prepare document for signature. error.Retry=Retry error.SaveOutputFolder=Failed to save signed document to configured output folder. @@ -77,8 +77,8 @@ error.SignaturePanel.NoRender="Could not render page" error.TanTooLong=Entered TAN too long error.Unexpected=Unexpected Error error.title=Error -exception.InvalidEmblemFile=is an invalid signature logo file! -exception.InvalidPort=is invalid has to be between 1 and +exception.InvalidEmblemFile=%s is an invalid signature logo file! +exception.InvalidPort=%s is invalid: has to be a number between %d and %d exception.PasswordTooLong=Given password is too long! exception.PasswordTooShort=Given password is too short! exception.PathNotDirectory=Path %s does not denote a directory! @@ -95,7 +95,7 @@ output.link_save_message=You can save the signed file output.success_message=Signature was successful positioning.newPage=Create &new Page positioning.page=Page %d of %d -positioning.removeNewPage=&Undo new Page +positioning.removeNewPage=Undo &new Page positioning.sign=&Sign positioning.signature=Signature simple_config.EmblemEmpty=Drag and Drop an image here\nor use the browse button \nto select a signature logo. @@ -104,9 +104,9 @@ simple_config.ExampleNumber=+43676123456789 simple_config.MobileBKU_Title=&Mobile signature simple_config.PhoneNumber=Mobile number: simple_config.ProxyHost=Host: -simple_config.ProxyHostTemplate=Hostname or IP of proxy server +simple_config.ProxyHostTemplate=Hostname or IP of the proxy server simple_config.ProxyPort=Port: -simple_config.ProxyPortTemplate=port proxy server [1-65535] +simple_config.ProxyPortTemplate=Port of the proxy server [1-65535] simple_config.Proxy_Title=&Proxy simple_config.ClearEmblem=&Clear simple_config.ExampleNumber_ToolTip=To use a default mobile phone number enter it here @@ -114,5 +114,5 @@ simple_config.ProxyHost_ToolTip=To use a proxy server enter the hostname or the simple_config.ProxyPort_ToolTip=To use a proxy server enter the port number here tanEnter.ReferenceValue=Reference value tanEnter.TAN=TAN: -tanEnter.tries=tries left! -waiting.message=Signature creation in progress... +tanEnter.tries=%d tries left! +waiting.message=Signature creation in progress... |