summaryrefslogtreecommitdiff
path: root/trunk/pdf-over-gui/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/pdf-over-gui/src/main/java')
-rw-r--r--trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java2
-rw-r--r--trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java2
-rw-r--r--trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java6
-rw-r--r--trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java4
-rw-r--r--trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java15
5 files changed, 21 insertions, 8 deletions
diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java
index 833d2670..fcd7084f 100644
--- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java
+++ b/trunk/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/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
index 7f73d0c8..a9ea31d2 100644
--- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
+++ b/trunk/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/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
index 5d32ec30..04b10d9c 100644
--- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
+++ b/trunk/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/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java
index 0657da7c..0d3306fa 100644
--- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidEmblemFile.java
+++ b/trunk/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/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java
index 3a37d3a0..98b05c79 100644
--- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/exceptions/InvalidPortException.java
+++ b/trunk/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$
}
}