summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:13:18 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:13:18 +0000
commit303ad8174d07db79c8cb365a140c327fb5dd2791 (patch)
tree55128b2f16ff6060982478098de9c3f87bbadaa5 /pdf-over-gui/src/main/java/at/asit/pdfover/gui
parent29fe21cebaa0ed7811da9373ef514f6f5057b4e9 (diff)
downloadmocca-303ad8174d07db79c8cb365a140c327fb5dd2791.tar.gz
mocca-303ad8174d07db79c8cb365a140c327fb5dd2791.tar.bz2
mocca-303ad8174d07db79c8cb365a140c327fb5dd2791.zip
Message strings update
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@202 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java6
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java4
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java15
5 files changed, 21 insertions, 8 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$
}
}