From 9aa77463452825ebaf542a42984f8aa14478b729 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Thu, 4 Aug 2022 12:01:57 +0200 Subject: batch replace v2 --- .../java/at/asit/pdfover/gui/PlaceholderSelectionGui.java | 4 ++-- .../pdfover/gui/composites/DataSourceSelectComposite.java | 3 +-- .../pdfover/gui/composites/MobileBKUEnterTANComposite.java | 8 +++----- .../gui/composites/MobileBKUFingerprintComposite.java | 3 +-- .../at/asit/pdfover/gui/composites/MobileBKUQRComposite.java | 3 +-- .../java/at/asit/pdfover/gui/composites/OutputComposite.java | 12 ++++-------- .../configuration/AdvancedConfigurationComposite.java | 6 +++--- .../configuration/SimpleConfigurationComposite.java | 1 - .../main/java/at/asit/pdfover/gui/controls/InputDialog.java | 6 +++--- .../src/main/java/at/asit/pdfover/gui/utils/SWTUtils.java | 1 - .../java/at/asit/pdfover/gui/workflow/states/OpenState.java | 5 +++-- 11 files changed, 21 insertions(+), 31 deletions(-) (limited to 'pdf-over-gui/src') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java index eab3de92..f06e9f92 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/PlaceholderSelectionGui.java @@ -18,7 +18,7 @@ package at.asit.pdfover.gui; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; -import at.asit.pdfover.commons.Messages; +import at.asit.pdfover.gui.utils.SWTUtils; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Dialog; @@ -127,7 +127,7 @@ public class PlaceholderSelectionGui extends Dialog { Label lbLabel = new Label(this.shlInfo, SWT.WRAP); lbLabel.setBounds(27, 10, 223, 41); - lbLabel.setText(Messages.getString("positioning.placeholder")); + SWTUtils.setLocalizedText(lbLabel, "positioning.placeholder"); } 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 43e272a2..6803d742 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 @@ -277,8 +277,7 @@ public class DataSourceSelectComposite extends StateComposite { FontData[] fD2 = this.lbl_drag2.getFont().getFontData(); fD2[0].setHeight(Constants.TEXT_SIZE_NORMAL); this.lbl_drag2.setFont(new Font(Display.getCurrent(), fD2[0])); - this.lbl_drag2.setText(Messages - .getString("dataSourceSelection.DropLabel2")); + SWTUtils.setLocalizedText(lbl_drag2, "dataSourceSelection.DropLabel2"); this.lbl_drag2.setAlignment(SWT.CENTER); this.btn_open = new Button(this.drop_area, SWT.NATIVE | SWT.RESIZE); 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 40a10fd6..fd91d139 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 @@ -340,8 +340,7 @@ public class MobileBKUEnterTANComposite extends StateComposite { // fd_lblRefValLabel.top = new FormAttachment(30, -15); fd_lblRefValLabel.bottom = new FormAttachment(50, -10); this.lblRefValLabel.setLayoutData(fd_lblRefValLabel); - this.lblRefValLabel.setText(Messages - .getString("tanEnter.ReferenceValue")); + SWTUtils.setLocalizedText(lblRefValLabel, "tanEnter.ReferenceValue"); Label lbl_image = new Label(containerComposite, SWT.NATIVE); @@ -420,7 +419,7 @@ public class MobileBKUEnterTANComposite extends StateComposite { lnk_sig_data.setEnabled(true); lnk_sig_data.setLayoutData(fd_lnk_data); lnk_sig_data.addSelectionListener(new ShowSignatureDataListener()); - lnk_sig_data.setText(Messages.getString("mobileBKU.show")); + SWTUtils.setLocalizedText(lnk_sig_data, "mobileBKU.show"); lnk_sig_data.setToolTipText(Messages.getString("mobileBKU.show_tooltip")); this.btn_ok = new Button(containerComposite, SWT.NATIVE); @@ -477,8 +476,7 @@ public class MobileBKUEnterTANComposite extends StateComposite { */ @Override public void reloadResources() { - this.lblRefValLabel.setText(Messages - .getString("tanEnter.ReferenceValue")); + SWTUtils.setLocalizedText(lblRefValLabel, "tanEnter.ReferenceValue"); SWTUtils.setLocalizedText(lblTan, "tanEnter.TAN"); } } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java index d1affdd3..9bb586c2 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUFingerprintComposite.java @@ -370,8 +370,7 @@ public class MobileBKUFingerprintComposite extends StateComposite { */ @Override public void reloadResources() { - this.lblRefValLabel.setText(Messages - .getString("tanEnter.ReferenceValue")); + SWTUtils.setLocalizedText(lblRefValLabel, "tanEnter.ReferenceValue"); SWTUtils.setLocalizedText(lblFPLabel, "tanEnter.FP"); SWTUtils.setLocalizedText(lnk_sig_data, "mobileBKU.show"); this.lnk_sig_data.setToolTipText(Messages.getString("mobileBKU.show_tooltip")); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUQRComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUQRComposite.java index 32fb00d6..006f7866 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUQRComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUQRComposite.java @@ -394,8 +394,7 @@ public class MobileBKUQRComposite extends StateComposite { */ @Override public void reloadResources() { - this.lblRefValLabel.setText(Messages - .getString("tanEnter.ReferenceValue")); + SWTUtils.setLocalizedText(lblRefValLabel, "tanEnter.ReferenceValue"); SWTUtils.setLocalizedText(lblQRLabel, "tanEnter.QR"); SWTUtils.setLocalizedText(lnk_sig_data, "mobileBKU.show"); this.lnk_sig_data.setToolTipText(Messages.getString("mobileBKU.show_tooltip")); 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 05e23f10..ceb0b7bb 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 @@ -467,14 +467,11 @@ public class OutputComposite extends StateComposite { */ @Override public void reloadResources() { - this.lbl_success_message.setText(Messages - .getString("output.success_message")); + SWTUtils.setLocalizedText(lbl_success_message, "output.success_message"); if (this.outputFile == null) { - this.lnk_saved_file.setText(Messages - .getString("output.link_save_message")); + SWTUtils.setLocalizedText(lnk_saved_file, "output.link_save_message"); } else { - this.lnk_saved_file.setText(Messages - .getString("output.link_open_message")); + SWTUtils.setLocalizedText(lnk_saved_file, "output.link_open_message"); } SWTUtils.setLocalizedText(btn_save, "common.Save"); } @@ -485,8 +482,7 @@ public class OutputComposite extends StateComposite { public void reReloadResources(String str) { SWTUtils.setLocalizedText(lbl_success_message, "output.success_message"); if (this.outputFile == null) { - this.lnk_saved_file.setText(Messages - .getString("output.link_save_message")); + SWTUtils.setLocalizedText(lnk_saved_file, "output.link_save_message"); } else { String str2 = "File location: " + str; this.lbl_success_message.setText(str2); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java index 1deb0cf1..4d0bd3c5 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java @@ -299,9 +299,9 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { // Set the initial filter path according // to anything they've selected or typed in dlg.setFilterPath(AdvancedConfigurationComposite.this.txtOutputFolder.getText()); - + // Change the title bar text - dlg.setText(Messages.getString("advanced_config.OutputFolder.Dialog_Title")); + SWTUtils.setLocalizedText(dlg, "advanced_config.OutputFolder.Dialog_Title"); // Customizable message displayed in the dialog dlg.setMessage(Messages.getString("advanced_config.OutputFolder.Dialog")); @@ -318,7 +318,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { }); this.lblSaveFilePostFix = new Label(this.grpSpeicherort, SWT.NONE); - lblSaveFilePostFix.setText(Messages.getString("AdvancedConfigurationComposite.lblSaveFilePostFix.text")); + SWTUtils.setLocalizedText(lblSaveFilePostFix, "AdvancedConfigurationComposite.lblSaveFilePostFix.text"); SWTUtils.setFontHeight(lblSaveFilePostFix, Constants.TEXT_SIZE_NORMAL); this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.BORDER); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java index 5e5895ff..03ba7b60 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java @@ -18,7 +18,6 @@ package at.asit.pdfover.gui.composites.configuration; import java.awt.image.BufferedImage; // Imports import java.io.File; -import java.io.IOException; import java.util.Arrays; import java.util.Locale; diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java index 15625539..4845863f 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/InputDialog.java @@ -28,7 +28,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; -import at.asit.pdfover.commons.Messages; +import at.asit.pdfover.gui.utils.SWTUtils; /** * @@ -134,7 +134,7 @@ public class InputDialog extends org.eclipse.swt.widgets.Dialog { data.horizontalSpan = 2; text.setLayoutData(data); Button ok = new Button(shell, SWT.PUSH); - ok.setText(Messages.getString("common.Ok")); + SWTUtils.setLocalizedText(ok, "common.Ok"); data = new GridData(GridData.FILL_HORIZONTAL); ok.setLayoutData(data); ok.addSelectionListener(new SelectionAdapter() { @@ -145,7 +145,7 @@ public class InputDialog extends org.eclipse.swt.widgets.Dialog { } }); Button cancel = new Button(shell, SWT.PUSH); - cancel.setText(Messages.getString("common.Cancel")); + SWTUtils.setLocalizedText(cancel, "common.Cancel"); data = new GridData(GridData.FILL_HORIZONTAL); cancel.setLayoutData(data); cancel.addSelectionListener(new SelectionAdapter() { diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SWTUtils.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SWTUtils.java index 9b37117b..8c902407 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SWTUtils.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/SWTUtils.java @@ -13,7 +13,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.commons.Messages; -import at.asit.pdfover.gui.composites.StateComposite; public final class SWTUtils { diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java index f76c5137..22a93246 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OpenState.java @@ -37,6 +37,7 @@ import at.asit.pdfover.gui.MainWindow.Buttons; import at.asit.pdfover.gui.MainWindowBehavior; import at.asit.pdfover.gui.PlaceholderSelectionGui; import at.asit.pdfover.gui.composites.DataSourceSelectComposite; +import at.asit.pdfover.gui.utils.SWTUtils; import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; @@ -127,7 +128,7 @@ public class OpenState extends State { // icon MessageBox dialog = new MessageBox(getStateMachine().getMainShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL); - dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); + SWTUtils.setLocalizedText(dialog, "dataSourceSelection.usePlaceholderTitle"); dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); // open dialog and await user selection @@ -173,7 +174,7 @@ public class OpenState extends State { // create a dialog with ok and cancel buttons and a question icon MessageBox dialog = new MessageBox(getStateMachine().getMainShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL); - dialog.setText(Messages.getString("dataSourceSelection.usePlaceholderTitle")); + SWTUtils.setLocalizedText(dialog, "dataSourceSelection.usePlaceholderTitle"); dialog.setMessage(Messages.getString("dataSourceSelection.usePlaceholderText")); // open dialog and await user selection -- cgit v1.2.3