summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java47
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java9
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java15
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java15
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java11
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java28
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java15
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java45
8 files changed, 111 insertions, 74 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java
index 11f0914d..2c25bd61 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java
@@ -21,6 +21,7 @@ import org.eclipse.swt.widgets.TabItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.workflow.ConfigurationContainer;
import at.asit.pdfover.gui.workflow.states.State;
@@ -50,6 +51,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
* @param parent
* @param style
* @param state
+ * @param container
*/
public AdvancedConfigurationComposite(Composite parent, int style,
State state, ConfigurationContainer container) {
@@ -65,7 +67,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
tabFolder.setLayoutData(fd_tabFolder);
TabItem simpleTabItem = new TabItem(tabFolder, SWT.NULL);
- simpleTabItem.setText("Simple");
+ simpleTabItem.setText(Messages.getString("config.Simple")); //$NON-NLS-1$
this.simpleComposite = new SimpleConfigurationComposite(tabFolder,
SWT.NONE, state, container);
@@ -73,7 +75,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
simpleTabItem.setControl(this.simpleComposite);
TabItem advancedTabItem = new TabItem(tabFolder, SWT.NULL);
- advancedTabItem.setText("Advanced");
+ advancedTabItem.setText(Messages.getString("config.Advanced")); //$NON-NLS-1$
Composite advancedComposite = new Composite(tabFolder, SWT.NONE);
@@ -81,7 +83,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
advancedComposite.setLayout(new FormLayout());
Group grpSignaturPosition = new Group(advancedComposite, SWT.NONE);
- grpSignaturPosition.setText("Signatur Position");
+ grpSignaturPosition.setText(Messages.getString("advanced_config.AutoPosition_Title")); //$NON-NLS-1$
grpSignaturPosition.setLayout(new FormLayout());
FormData fd_grpSignaturPosition = new FormData();
fd_grpSignaturPosition.top = new FormAttachment(0, 5);
@@ -98,7 +100,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
fd_btnAutomatischePositionierung.left = new FormAttachment(0, 5);
this.btnAutomatischePositionierung
.setLayoutData(fd_btnAutomatischePositionierung);
- this.btnAutomatischePositionierung.setText("Automatische Positionierung");
+ this.btnAutomatischePositionierung.setText(Messages.getString("advanced_config.AutoPosition")); //$NON-NLS-1$
this.btnAutomatischePositionierung.addSelectionListener(new SelectionListener() {
@@ -115,7 +117,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
});
Group grpBkuAuswahl = new Group(advancedComposite, SWT.NONE);
- grpBkuAuswahl.setText("BKU Selection");
+ grpBkuAuswahl.setText(Messages.getString("advanced_config.BKUSelection_Title")); //$NON-NLS-1$
grpBkuAuswahl.setLayout(new FormLayout());
FormData fd_grpBkuAuswahl = new FormData();
fd_grpBkuAuswahl.top = new FormAttachment(33, 5);
@@ -134,9 +136,9 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
this.bkuStrings = new String[blen];
- // TODO: Implement translation into user language for ENUM Values!!
for (int i = 0; i < blen; i++) {
- this.bkuStrings[i] = BKUs.values()[i].toString();
+ String lookup = "BKU." + BKUs.values()[i].toString(); //$NON-NLS-1$
+ this.bkuStrings[i] = Messages.getString(lookup);
}
this.cmbBKUAuswahl.setItems(this.bkuStrings);
@@ -161,7 +163,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
});
Group grpSpeicherort = new Group(advancedComposite, SWT.NONE);
- grpSpeicherort.setText("Outputfolder");
+ grpSpeicherort.setText(Messages.getString("advanced_config.OutputFolder_Title")); //$NON-NLS-1$
grpSpeicherort.setLayout(new FormLayout());
FormData fd_grpSpeicherort = new FormData();
fd_grpSpeicherort.top = new FormAttachment(66, 5);
@@ -175,7 +177,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
fd_lblDefaultOutputFolder.top = new FormAttachment(0, 5);
fd_lblDefaultOutputFolder.left = new FormAttachment(0, 5);
lblDefaultOutputFolder.setLayoutData(fd_lblDefaultOutputFolder);
- lblDefaultOutputFolder.setText("Default output folder:");
+ lblDefaultOutputFolder.setText(Messages.getString("advanced_config.OutputFolder")); //$NON-NLS-1$
this.txtOutputFolder = new Text(grpSpeicherort, SWT.BORDER);
FormData fd_text = new FormData();
@@ -203,7 +205,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
fd_btnBrowse.top = new FormAttachment(lblDefaultOutputFolder, 5);
fd_btnBrowse.right = new FormAttachment(100, -5);
btnBrowse.setLayoutData(fd_btnBrowse);
- btnBrowse.setText("browse");
+ btnBrowse.setText(Messages.getString("common.browse")); //$NON-NLS-1$
btnBrowse.addSelectionListener(new SelectionListener() {
@@ -218,10 +220,10 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
.getText());
// Change the title bar text
- dlg.setText("Select Output folder");
+ dlg.setText(Messages.getString("advanced_config.OutputFolder.Dialog_Title")); //$NON-NLS-1$
// Customizable message displayed in the dialog
- dlg.setMessage("Select a directory");
+ dlg.setMessage(Messages.getString("advanced_config.OutputFolder.Dialog")); //$NON-NLS-1$
// Calling open() will open and run the dialog.
// It will return the selected directory, or
@@ -247,8 +249,8 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
}
int getBKUElementIndex(BKUs bku) {
- // TODO: Translate to user language!
- String bkuName = bku.toString();
+ String lookup = "BKU." + bku.toString(); //$NON-NLS-1$
+ String bkuName = Messages.getString(lookup);
for(int i = 0; i < this.bkuStrings.length; i++) {
if(this.bkuStrings[i].equals(bkuName)) {
@@ -269,15 +271,28 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
void performBKUSelectionChanged(String selected) {
try {
- BKUs bkuvalue = BKUs.valueOf(selected);
+ BKUs bkuvalue = resolvBKU(selected);
this.performBKUSelectionChanged(bkuvalue);
} catch (Exception ex) {
log.error("Failed to parse BKU value: " + selected, ex); //$NON-NLS-1$
- ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE, "Invalid BKU selection. Please check.", ex, false);
+ ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE, Messages.getString("error.InvalidBKU"), ex, false); //$NON-NLS-1$
dialog.open();
}
}
+ BKUs resolvBKU(String localizedBKU) {
+ int blen = BKUs.values().length;
+
+ for (int i = 0; i < blen; i++) {
+ String lookup = "BKU." + BKUs.values()[i].toString(); //$NON-NLS-1$
+ if(Messages.getString(lookup).equals(localizedBKU)) {
+ return BKUs.values()[i];
+ }
+ }
+
+ return BKUs.NONE;
+ }
+
void performPositionSelection(boolean automatic) {
log.debug("Selected Position: " + automatic); //$NON-NLS-1$
this.configurationContainer.setAutomaticPosition(automatic);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java
index 19b3f46c..dc8640de 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java
@@ -29,6 +29,7 @@ import org.eclipse.swt.widgets.Composite;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.workflow.states.State;
import at.asit.pdfover.signator.BKUs;
@@ -110,7 +111,7 @@ public class BKUSelectionComposite extends StateComposite {
Button btn_mobile = new Button(this, SWT.NATIVE | SWT.RESIZE);
- btn_mobile.setText("MOBILE");
+ btn_mobile.setText(Messages.getString("bku_selection.mobile")); //$NON-NLS-1$
//Point mobile_size = btn_mobile.computeSize(SWT.DEFAULT, SWT.DEFAULT);
FormData fd_btn_mobile = new FormData();
//fd_btn_mobile.left = new FormAttachment(40, 0);
@@ -120,12 +121,12 @@ public class BKUSelectionComposite extends StateComposite {
btn_mobile.setLayoutData(fd_btn_mobile);
btn_mobile.addSelectionListener(new MobileSelectionListener());
- Image mobile = new Image(getDisplay(), new ImageData(this.getClass().getResourceAsStream("/img/handy.gif")));
+ Image mobile = new Image(getDisplay(), new ImageData(this.getClass().getResourceAsStream("/img/handy.gif"))); //$NON-NLS-1$
btn_mobile.setImage(mobile);
Button btn_card = new Button(this, SWT.NATIVE | SWT.RESIZE);
- btn_card.setText("CARD");
+ btn_card.setText(Messages.getString("bku_selection.card")); //$NON-NLS-1$
//Point card_size = btn_card.computeSize(SWT.DEFAULT, SWT.DEFAULT);
FormData fd_btn_card = new FormData();
fd_btn_card.left = new FormAttachment(50, 5);
@@ -135,7 +136,7 @@ public class BKUSelectionComposite extends StateComposite {
btn_card.setLayoutData(fd_btn_card);
btn_card.addSelectionListener(new LocalSelectionListener());
- Image karte = new Image(getDisplay(), new ImageData(this.getClass().getResourceAsStream("/img/karte.gif")));
+ Image karte = new Image(getDisplay(), new ImageData(this.getClass().getResourceAsStream("/img/karte.gif"))); //$NON-NLS-1$
btn_card.setImage(karte);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
index bb6d47a5..abd2edb0 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
@@ -23,6 +23,7 @@ import org.eclipse.swt.widgets.Control;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.exceptions.InvalidEmblemFile;
import at.asit.pdfover.gui.exceptions.InvalidNumberException;
@@ -72,7 +73,7 @@ public class ConfigurationComposite extends StateComposite {
ConfigurationComposite.this.style,
ConfigurationComposite.this.state,
ConfigurationComposite.this.configurationContainer);
- ConfigurationComposite.this.btnAdvanced.setText("Simple");
+ ConfigurationComposite.this.btnAdvanced.setText(Messages.getString("config.Simple")); //$NON-NLS-1$
} else {
// switch to simple
ConfigurationComposite.this.configComposite.dispose();
@@ -81,7 +82,7 @@ public class ConfigurationComposite extends StateComposite {
ConfigurationComposite.this.style,
ConfigurationComposite.this.state,
ConfigurationComposite.this.configurationContainer);
- ConfigurationComposite.this.btnAdvanced.setText("Advanced");
+ ConfigurationComposite.this.btnAdvanced.setText(Messages.getString("config.Advanced")); //$NON-NLS-1$
}
ConfigurationComposite.this.configComposite.loadConfiguration();
@@ -247,14 +248,14 @@ public class ConfigurationComposite extends StateComposite {
}
}
});
- btnSpeichern.setText("Speichern");
+ btnSpeichern.setText(Messages.getString("common.Save")); //$NON-NLS-1$
Button btnAbbrechen = new Button(this, SWT.NONE);
FormData fd_btnAbrechen = new FormData();
fd_btnAbrechen.left = new FormAttachment(btnSpeichern, 10);
fd_btnAbrechen.bottom = new FormAttachment(100, -5);
btnAbbrechen.setLayoutData(fd_btnAbrechen);
- btnAbbrechen.setText("Abbrechen");
+ btnAbbrechen.setText(Messages.getString("common.Cancel")); //$NON-NLS-1$
btnAbbrechen.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -268,7 +269,7 @@ public class ConfigurationComposite extends StateComposite {
fd_btnAdvanced.right = new FormAttachment(100, -5);
fd_btnAdvanced.bottom = new FormAttachment(100, -5);
this.btnAdvanced.setLayoutData(fd_btnAdvanced);
- this.btnAdvanced.setText("Advanced");
+ this.btnAdvanced.setText(Messages.getString("config.Advanced")); //$NON-NLS-1$
this.btnAdvanced
.addSelectionListener(new ConfigurationModeSelectionListener());
@@ -308,7 +309,7 @@ public class ConfigurationComposite extends StateComposite {
ErrorDialog dialog = new ErrorDialog(
getShell(),
SWT.NONE,
- "Invalid settings are still present. Please check your input.",
+ Messages.getString("error.InvalidSettings"), //$NON-NLS-1$
e, false);
dialog.open();
return false;
@@ -325,7 +326,7 @@ public class ConfigurationComposite extends StateComposite {
} catch (IOException e) {
log.error("Failed to save configuration to file!", e); //$NON-NLS-1$
ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE,
- "Failed to save configuration file!", e, true);
+ Messages.getString("error.FailedToSaveSettings"), e, true); //$NON-NLS-1$
redo = dialog.open();
//return false;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java
index 8146a02d..1784988a 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java
@@ -27,7 +27,6 @@ import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Point;
@@ -44,6 +43,7 @@ import org.eclipse.swt.widgets.Listener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.workflow.states.State;
/**
@@ -67,7 +67,9 @@ public class DataSourceSelectComposite extends StateComposite {
FileDialog dialog = new FileDialog(
DataSourceSelectComposite.this.getShell(), SWT.OPEN);
dialog.setFilterExtensions(new String[] { "*.pdf", "*" }); //$NON-NLS-1$ //$NON-NLS-2$
- dialog.setFilterNames(new String[] { "PDF documents", "All files" });
+ dialog.setFilterNames(new String[] {
+ Messages.getString("common.PDFExtension_Description"), //$NON-NLS-1$
+ Messages.getString("common.ALLExtension_Description") }); //$NON-NLS-1$
String fileName = dialog.open();
File file = null;
if (fileName != null) {
@@ -148,7 +150,8 @@ public class DataSourceSelectComposite extends StateComposite {
// Only taking first file ...
File file = new File(files[0]);
if (!file.exists()) {
- log.error("File: " + files[0] + " does not exist!");
+ log.error(Messages.getString("common.file") + " " + files[0] + //$NON-NLS-1$ //$NON-NLS-2$
+ Messages.getString("common.file_not_exists")); //$NON-NLS-1$
return;
}
DataSourceSelectComposite.this.setSelected(file);
@@ -201,15 +204,15 @@ public class DataSourceSelectComposite extends StateComposite {
this.fd_lbl_drag.right = new FormAttachment(100, -10);
this.fd_lbl_drag.top = new FormAttachment(0, 10);
// fd_lbl_drag.bottom = new FormAttachment(100, -10);
- lbl_drag.setLayoutData(fd_lbl_drag);
+ lbl_drag.setLayoutData(this.fd_lbl_drag);
FontData[] fD = lbl_drag.getFont().getFontData();
fD[0].setHeight(18);
lbl_drag.setFont(new Font(Display.getCurrent(), fD[0]));
- lbl_drag.setText("To sign a document\ndrag and drop it here\nor use the button below");
+ lbl_drag.setText(Messages.getString("dataSourceSelection.DropLabel")); //$NON-NLS-1$
lbl_drag.setAlignment(SWT.CENTER);
final Button btn_open = new Button(this.drop_area, SWT.NATIVE | SWT.RESIZE);
- btn_open.setText("Choose file ...");
+ btn_open.setText(Messages.getString("common.browse")); //$NON-NLS-1$
lbl_drag.addListener(SWT.Resize, new Listener() {
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java
index 6552c3d5..befde87a 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java
@@ -29,6 +29,7 @@ import org.eclipse.swt.widgets.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.exceptions.InvalidNumberException;
import at.asit.pdfover.gui.exceptions.InvalidPasswordException;
import at.asit.pdfover.gui.workflow.states.State;
@@ -78,7 +79,7 @@ public class MobileBKUEnterNumberComposite extends StateComposite {
} catch(InvalidNumberException ex) {
log.error("Validating input for Mobile BKU failed!", ex); //$NON-NLS-1$
MobileBKUEnterNumberComposite.this
- .setErrorMessage("Given phone number is invalid! Example: +43664123456789");
+ .setErrorMessage(Messages.getString("error.InvalidPhoneNumber")); //$NON-NLS-1$
} catch(InvalidPasswordException ex) {
log.error("Validating input for Mobile BKU failed!", ex); //$NON-NLS-1$
MobileBKUEnterNumberComposite.this
@@ -87,7 +88,7 @@ public class MobileBKUEnterNumberComposite extends StateComposite {
catch (Exception ex) {
log.error("Validating input for Mobile BKU failed!", ex); //$NON-NLS-1$
MobileBKUEnterNumberComposite.this
- .setErrorMessage("Given phone number is invalid! Example: +43664123456789");
+ .setErrorMessage(Messages.getString("error.InvalidPhoneNumber")); //$NON-NLS-1$
return;
}
@@ -175,7 +176,7 @@ public class MobileBKUEnterNumberComposite extends StateComposite {
this.txt_number.setEditable(true);
Label lbl_number = new Label(this, SWT.NATIVE);
- lbl_number.setText("Nummer:");
+ lbl_number.setText(Messages.getString("mobileBKU.number")); //$NON-NLS-1$
FormData fd_lbl_number = new FormData();
fd_lbl_number.top = new FormAttachment(30, -15);
fd_lbl_number.bottom = new FormAttachment(30, 15);
@@ -194,7 +195,7 @@ public class MobileBKUEnterNumberComposite extends StateComposite {
this.txt_password.setEditable(true);
Label lbl_password = new Label(this, SWT.NATIVE);
- lbl_password.setText("Passwort:");
+ lbl_password.setText(Messages.getString("mobileBKU.password")); //$NON-NLS-1$
FormData fd_lbl_password = new FormData();
fd_lbl_password.top = new FormAttachment(50, -15);
fd_lbl_password.bottom = new FormAttachment(50, 15);
@@ -211,7 +212,7 @@ public class MobileBKUEnterNumberComposite extends StateComposite {
this.lbl_error.setLayoutData(fd_lbl_error);
Button btn_ok = new Button(this, SWT.NATIVE);
- btn_ok.setText("Ok");
+ btn_ok.setText(Messages.getString("common.Ok")); //$NON-NLS-1$
FormData fd_btn_ok = new FormData();
fd_btn_ok.top = new FormAttachment(87, 0);
fd_btn_ok.bottom = new FormAttachment(95, 0);
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 ff8d5c63..f19ee361 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
@@ -29,6 +29,7 @@ import org.eclipse.swt.widgets.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.workflow.states.State;
/**
@@ -52,12 +53,12 @@ public class MobileBKUEnterTANComposite extends StateComposite {
tan = tan.trim();
if(MobileBKUEnterTANComposite.this.vergleichswert.startsWith(tan)) {
- MobileBKUEnterTANComposite.this.setMessage("Sie haben den Vergleichswert eingegeben!");
+ MobileBKUEnterTANComposite.this.setMessage(Messages.getString("error.EnteredReferenceValue")); //$NON-NLS-1$
return;
}
if(tan.length() > 6) {
- MobileBKUEnterTANComposite.this.setMessage("Eingabe zu lange für TAN");
+ MobileBKUEnterTANComposite.this.setMessage(Messages.getString("error.TanTooLong")); //$NON-NLS-1$
return;
}
@@ -70,6 +71,7 @@ public class MobileBKUEnterTANComposite extends StateComposite {
/**
* SLF4J Logger instance
**/
+ @SuppressWarnings("unused")
private static final Logger log = LoggerFactory
.getLogger(MobileBKUEnterTANComposite.class);
@@ -84,10 +86,18 @@ public class MobileBKUEnterTANComposite extends StateComposite {
return this.userAck;
}
+ /**
+ * Set how many tries are left
+ * @param tries
+ */
public void setTries(int tries) {
- this.lbl_tries.setText(tries + " tries left!");
+ this.lbl_tries.setText(tries + Messages.getString("tanEnter.tries")); //$NON-NLS-1$
}
+ /**
+ * Sets the message
+ * @param msg
+ */
public void setMessage(String msg) {
this.lbl_tries.setText(msg);
}
@@ -123,7 +133,7 @@ public class MobileBKUEnterTANComposite extends StateComposite {
if(this.vergleichswert != null) {
this.lblvergleich.setText(this.vergleichswert);
} else {
- this.lblvergleich.setText("");
+ this.lblvergleich.setText(""); //$NON-NLS-1$
}
}
@@ -165,7 +175,7 @@ public class MobileBKUEnterTANComposite extends StateComposite {
fd_lblVergleichswert.top = new FormAttachment(30, -15);
fd_lblVergleichswert.bottom = new FormAttachment(30, 15);
lblVergleichswert.setLayoutData(fd_lblVergleichswert);
- lblVergleichswert.setText("Vergleichswert");
+ lblVergleichswert.setText(Messages.getString("tanEnter.ReferenceValue")); //$NON-NLS-1$
this.lblvergleich = new Label(this, SWT.NATIVE);
FormData fd_lblvergleich = new FormData();
@@ -174,7 +184,7 @@ public class MobileBKUEnterTANComposite extends StateComposite {
fd_lblvergleich.top = new FormAttachment(30, -15);
fd_lblvergleich.bottom = new FormAttachment(30, 15);
this.lblvergleich.setLayoutData(fd_lblvergleich);
- this.lblvergleich.setText("New Label"); //$NON-NLS-1$
+ this.lblvergleich.setText(""); //$NON-NLS-1$
Label lblTan = new Label(this, SWT.NATIVE);
FormData fd_lblTan = new FormData();
@@ -183,7 +193,7 @@ public class MobileBKUEnterTANComposite extends StateComposite {
fd_lblTan.top = new FormAttachment(50, -15);
fd_lblTan.bottom = new FormAttachment(50, 15);
lblTan.setLayoutData(fd_lblTan);
- lblTan.setText("TAN:");
+ lblTan.setText(Messages.getString("tanEnter.TAN")); //$NON-NLS-1$
this.txt_tan = new Text(this, SWT.BORDER | SWT.NATIVE);
FormData fd_text = new FormData();
@@ -204,13 +214,13 @@ public class MobileBKUEnterTANComposite extends StateComposite {
Button btn_ok = new Button(this, SWT.NATIVE);
FormData fd_btn_ok = new FormData();
- fd_btn_ok.left = new FormAttachment(15, 0);
+ //fd_btn_ok.left = new FormAttachment(95, 0);
fd_btn_ok.right = new FormAttachment(95, 0);
fd_btn_ok.top = new FormAttachment(85);
fd_btn_ok.bottom = new FormAttachment(95);
btn_ok.setLayoutData(fd_btn_ok);
- btn_ok.setText("Ok");
+ btn_ok.setText(Messages.getString("common.Ok")); //$NON-NLS-1$
btn_ok.addSelectionListener(new OkSelectionListener());
}
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 9cdabe23..84801702 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
@@ -32,6 +32,7 @@ import org.eclipse.swt.widgets.FileDialog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.workflow.states.State;
import at.asit.pdfover.signator.DocumentSource;
@@ -62,7 +63,7 @@ public class OutputComposite extends StateComposite {
try {
FileDialog save = new FileDialog(OutputComposite.this.getShell(), SWT.SAVE | SWT.NATIVE);
save.setFilterExtensions(new String[] {"*.pdf"}); //$NON-NLS-1$
- save.setFilterNames(new String[] {"PDF Dateien"});
+ save.setFilterNames(new String[] {Messages.getString("common.PDFExtension_Description")}); //$NON-NLS-1$
String target = save.open();
@@ -104,7 +105,9 @@ public class OutputComposite extends StateComposite {
File open = OutputComposite.this.savedFile;
if (open == null) {
// Save as temp file ...
- open = new File("tmp_signed.pdf");
+ java.util.Date date= new java.util.Date();
+ String fileName = String.format("%d_tmp_signed.pdf", date.getTime()); //$NON-NLS-1$
+ open = new File(fileName);
FileOutputStream outstream = new FileOutputStream(open);
outstream.write(source.getByteArray(), 0,
source.getByteArray().length);
@@ -118,7 +121,9 @@ public class OutputComposite extends StateComposite {
}
} else {
log.error("OutputComposite:OpenSelectionListener:widgetSelected -> source is null!!"); //$NON-NLS-1$
- ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE, "Failed to get signed document.", "", false);
+ ErrorDialog dialog = new ErrorDialog(getShell(),
+ SWT.NONE, Messages.getString("error.FailedToGetSignedDocument"),//$NON-NLS-1$
+ "", false); //$NON-NLS-1$
dialog.open();
}
} catch (Exception ex) {
@@ -147,7 +152,7 @@ public class OutputComposite extends StateComposite {
this.setLayout(new FormLayout());
Button btn_open = new Button(this, SWT.NATIVE | SWT.RESIZE);
- btn_open.setText("OPEN");
+ btn_open.setText(Messages.getString("common.open")); //$NON-NLS-1$
// Point mobile_size = btn_mobile.computeSize(SWT.DEFAULT, SWT.DEFAULT);
FormData fd_btn_open = new FormData();
//fd_btn_open.left = new FormAttachment(40, 0);
@@ -162,7 +167,7 @@ public class OutputComposite extends StateComposite {
}
Button btn_save = new Button(this, SWT.NATIVE | SWT.RESIZE);
- btn_save.setText("SAVE");
+ btn_save.setText(Messages.getString("common.Save")); //$NON-NLS-1$
// Point card_size = btn_card.computeSize(SWT.DEFAULT, SWT.DEFAULT);
FormData fd_btn_save = new FormData();
fd_btn_save.left = new FormAttachment(50, 5);
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 6bac14ec..f70ff85e 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
@@ -27,8 +27,6 @@ import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -42,7 +40,6 @@ import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
@@ -54,6 +51,7 @@ import org.eclipse.swt.widgets.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.controls.ErrorMarker;
import at.asit.pdfover.gui.exceptions.InvalidEmblemFile;
@@ -61,7 +59,6 @@ import at.asit.pdfover.gui.exceptions.InvalidNumberException;
import at.asit.pdfover.gui.exceptions.InvalidPortException;
import at.asit.pdfover.gui.workflow.ConfigurationContainer;
import at.asit.pdfover.gui.workflow.states.State;
-import org.eclipse.swt.layout.FillLayout;
/**
*
@@ -84,7 +81,9 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
FileDialog dialog = new FileDialog(
SimpleConfigurationComposite.this.getShell(), SWT.OPEN);
dialog.setFilterExtensions(new String[] { "*.jpg", "*.gif" }); //$NON-NLS-1$ //$NON-NLS-2$
- dialog.setFilterNames(new String[] { "JPG Dateien", "Gif Dateien" });
+ dialog.setFilterNames(new String[] {
+ Messages.getString("common.JPGExtension_Description"), //$NON-NLS-1$
+ Messages.getString("common.GIFExtension_Description") }); //$NON-NLS-1$
String fileName = dialog.open();
File file = null;
if (fileName != null) {
@@ -206,7 +205,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
this.recalculateEmblemSize();
} catch (Exception e) {
this.lblEmblem
- .setText("No Image. Drag and Drop a Image. Or use the browse button to select an emblem.");
+ .setText(Messages.getString("simple_config.EmblemEmpty")); //$NON-NLS-1$
this.lblEmblem.setImage(null);
if (this.origEmblem != null) {
this.origEmblem.dispose();
@@ -226,7 +225,8 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
plainEmblemSetter(filename);
} catch (Exception ex) {
log.error("processEmblemChanged: ", ex); //$NON-NLS-1$
- ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE, "Failed to load the emblem", ex, false);
+ ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE,
+ Messages.getString("error.FailedToLoadEmblem"), ex, false); //$NON-NLS-1$
dialog.open();
}
}
@@ -248,7 +248,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
} catch (Exception ex) {
this.txtMobileNumberErrorMarker.setVisible(true);
this.txtMobileNumberErrorMarker
- .setToolTipText("Phone number is invalid! Please provide in the form: +43676123456789");
+ .setToolTipText(Messages.getString("error.InvalidPhoneNumber")); //$NON-NLS-1$
log.error("processNumberChanged: ", ex); //$NON-NLS-1$
}
}
@@ -349,14 +349,14 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
fd_grpHandySignatur.top = new FormAttachment(0, 5);
fd_grpHandySignatur.bottom = new FormAttachment(20, -5);
grpHandySignatur.setLayoutData(fd_grpHandySignatur);
- grpHandySignatur.setText("Handy Signatur");
+ grpHandySignatur.setText(Messages.getString("simple_config.MobileBKU_Title")); //$NON-NLS-1$
grpHandySignatur.setLayout(new GridLayout(2, false));
Label lblMobileNumber = new Label(grpHandySignatur, SWT.NONE
| SWT.RESIZE);
lblMobileNumber.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false,
false, 1, 1));
- lblMobileNumber.setText("Handy Nummer:");
+ lblMobileNumber.setText(Messages.getString("simple_config.PhoneNumber")); //$NON-NLS-1$
Composite composite_2 = new Composite(grpHandySignatur, SWT.NONE);
composite_2.setLayout(new FormLayout());
@@ -392,7 +392,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
}
});
- this.txtMobileNumber.setMessage("+43676123456789");
+ this.txtMobileNumber.setMessage(Messages.getString("simple_config.ExampleNumber")); //$NON-NLS-1$
this.txtMobileNumber.addFocusListener(new FocusListener() {
@@ -415,7 +415,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
fd_grpBildmarke.top = new FormAttachment(20, 5);
grpBildmarke.setLayoutData(fd_grpBildmarke);
grpBildmarke.setLayout(new GridLayout(5, false));
- grpBildmarke.setText("Bildmarke");
+ grpBildmarke.setText(Messages.getString("simple_config.Emblem_Title")); //$NON-NLS-1$
new Label(grpBildmarke, SWT.NONE);
new Label(grpBildmarke, SWT.NONE);
@@ -424,7 +424,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
true, 3, 1));
this.lblEmblem.setAlignment(SWT.CENTER);
this.lblEmblem
- .setText("No Image. Drag and Drop a Image. Or use the browse button to select an emblem.");
+ .setText(Messages.getString("simple_config.EmblemEmpty")); //$NON-NLS-1$
this.lblEmblem.addListener(SWT.Resize, new Listener() {
@Override
@@ -499,7 +499,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
new Label(grpBildmarke, SWT.NONE);
this.btnUseImage = new Button(grpBildmarke, SWT.CHECK);
- this.btnUseImage.setText("Use Image");
+ this.btnUseImage.setText(Messages.getString("simple_config.UseEmblem")); //$NON-NLS-1$
this.btnUseImage.addSelectionListener(new SelectionListener() {
@Override
@@ -512,7 +512,8 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
SimpleConfigurationComposite.this.configurationContainer
.setEmblem(null);
} catch (InvalidEmblemFile e1) {
- log.error("THIS EXCEPTION IS IMPOSSIBLE! ", e1); //$NON-NLS-1$
+ // This exception should not occur!
+ log.error("Failed to load emblem", e1); //$NON-NLS-1$
}
}
}
@@ -528,7 +529,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
btnBrowseEmblem.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER,
false, false, 1, 1));
btnBrowseEmblem.addSelectionListener(new ImageFileBrowser());
- btnBrowseEmblem.setText("Browse");
+ btnBrowseEmblem.setText(Messages.getString("common.browse")); //$NON-NLS-1$
Group grpProxy = new Group(this, SWT.NONE);
FormData fd_grpProxy = new FormData();
@@ -537,7 +538,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
fd_grpProxy.left = new FormAttachment(0, 5);
fd_grpProxy.bottom = new FormAttachment(90, -5);
grpProxy.setLayoutData(fd_grpProxy);
- grpProxy.setText("Proxy");
+ grpProxy.setText(Messages.getString("simple_config.Proxy_Title")); //$NON-NLS-1$
grpProxy.setLayout(new GridLayout(2, false));
Label lblNewLabel = new Label(grpProxy, SWT.NONE);
@@ -546,7 +547,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
gd_lblNewLabel.widthHint = 66;
lblNewLabel.setLayoutData(gd_lblNewLabel);
lblNewLabel.setBounds(0, 0, 57, 15);
- lblNewLabel.setText("Host:");
+ lblNewLabel.setText(Messages.getString("simple_config.ProxyHost")); //$NON-NLS-1$
Composite composite = new Composite(grpProxy, SWT.NONE);
composite.setLayout(new FormLayout());
@@ -571,7 +572,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
this.proxyHostErrorMarker.setVisible(false);
this.txtProxyHost.setLayoutData(fd_txtProxyHost);
- this.txtProxyHost.setMessage("Hostname or IP of proxy server");
+ this.txtProxyHost.setMessage(Messages.getString("simple_config.ProxyHostTemplate")); //$NON-NLS-1$
this.txtProxyHost.addFocusListener(new FocusListener() {
@@ -598,7 +599,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
Label lblNewLabel_1 = new Label(grpProxy, SWT.NONE);
lblNewLabel_1.setBounds(0, 0, 57, 15);
- lblNewLabel_1.setText("Port:");
+ lblNewLabel_1.setText(Messages.getString("simple_config.ProxyPort")); //$NON-NLS-1$
Composite composite_1 = new Composite(grpProxy, SWT.NONE);
composite_1.setLayout(new FormLayout());
@@ -632,7 +633,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
.setLayoutData(this.fd_txtProxyPortErrorMarker);
this.txtProxyPortErrorMarker.setVisible(false);
- this.txtProxyPort.setMessage("port proxy server [1-65535]");
+ this.txtProxyPort.setMessage(Messages.getString("simple_config.ProxyPortTemplate")); //$NON-NLS-1$
this.txtProxyPort.addFocusListener(new FocusListener() {
@@ -728,7 +729,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
this.btnUseImage.setSelection(true);
} catch (Exception e1) {
log.error("Failed to load emblem: ", e1); //$NON-NLS-1$
- ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE, "Failed to load emblem.", e1, false);
+ ErrorDialog dialog = new ErrorDialog(getShell(), SWT.NONE, Messages.getString("error.FailedToLoadEmblem"), e1, false); //$NON-NLS-1$
dialog.open();
}
}