From e4767bccc7324d4b61a334bf6c0558d0080045e2 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Wed, 6 Jul 2022 12:33:33 +0200 Subject: remove NON-NLS comments, cleanup whitespace --- .../composites/configuration/AboutComposite.java | 2 +- .../AdvancedConfigurationComposite.java | 164 ++++++++++----------- .../configuration/ConfigurationCompositeBase.java | 12 +- .../KeystoreConfigurationComposite.java | 108 +++++++------- .../SimpleConfigurationComposite.java | 74 +++++----- 5 files changed, 180 insertions(+), 180 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java index a0a423c4..2779727f 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java @@ -127,7 +127,7 @@ public class AboutComposite extends ConfigurationCompositeBase { */ @Override public void reloadResources() { - this.lnkAbout.setText(Messages.getString("config.AboutText")); //$NON-NLS-1$ + this.lnkAbout.setText(Messages.getString("config.AboutText")); // this.lblDataProtection.setText(Messages.getString("config.DataProtection")); this.lnkDataProtection.setText(Messages.getString("config.DataProtectionStatement")); this.btnOpenLogDirectory.setText(Messages.getString("config.ShowLogDirectory")); 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 1c894e5c..6f8561e3 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 @@ -62,7 +62,7 @@ import at.asit.pdfover.signator.SignaturePosition; /** * Composite for advanced configuration - * + * * Contains the simple configuration composite */ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { @@ -301,10 +301,10 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { dlg.setFilterPath(AdvancedConfigurationComposite.this.txtOutputFolder.getText()); // Change the title bar text - dlg.setText(Messages.getString("advanced_config.OutputFolder.Dialog_Title")); //$NON-NLS-1$ + dlg.setText(Messages.getString("advanced_config.OutputFolder.Dialog_Title")); // // Customizable message displayed in the dialog - dlg.setMessage(Messages.getString("advanced_config.OutputFolder.Dialog")); //$NON-NLS-1$ + dlg.setMessage(Messages.getString("advanced_config.OutputFolder.Dialog")); // // Calling open() will open and run the dialog. // It will return the selected directory, or @@ -393,12 +393,12 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { Composite compProxyHostContainer = new Composite(this.grpProxy, SWT.NONE); compProxyHostContainer.setLayout(new FormLayout()); compProxyHostContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1)); - + this.txtProxyHost = new Text(compProxyHostContainer, SWT.BORDER); StateComposite.anchor(txtProxyHost).right(100,-42).top(0).left(0,5).set(); StateComposite.setFontHeight(txtProxyHost, Constants.TEXT_SIZE_NORMAL); - this.proxyHostErrorMarker = new ErrorMarker(compProxyHostContainer, SWT.NONE, ""); //$NON-NLS-1$ + this.proxyHostErrorMarker = new ErrorMarker(compProxyHostContainer, SWT.NONE, ""); // StateComposite.anchor(proxyHostErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set(); this.proxyHostErrorMarker.setVisible(false); @@ -433,7 +433,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { } }); - this.txtProxyPortErrorMarker = new ErrorMarker(compProxyPortContainer, SWT.NONE, ""); //$NON-NLS-1$ + this.txtProxyPortErrorMarker = new ErrorMarker(compProxyPortContainer, SWT.NONE, ""); // StateComposite.anchor(txtProxyPortErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set(); this.txtProxyPortErrorMarker.setVisible(false); @@ -449,14 +449,14 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { private void performPostFixChanged(String postfix) { - log.debug("Save file postfix changed to : {}", postfix); //$NON-NLS-1$ + log.debug("Save file postfix changed to : {}", postfix); // this.configurationContainer.setSaveFilePostFix(postfix); AdvancedConfigurationComposite.this.txtSaveFilePostFix.setText(postfix); } /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.composites.BaseConfigurationComposite#signerChanged() */ @@ -466,25 +466,25 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { } void performOutputFolderChanged(String foldername) { - log.debug("Selected Output folder: {}", foldername); //$NON-NLS-1$ + log.debug("Selected Output folder: {}", foldername); // this.configurationContainer.setOutputFolder(foldername); AdvancedConfigurationComposite.this.txtOutputFolder.setText(foldername); } int getBKUElementIndex(BKUs bku) { - String lookup = "BKU." + bku.toString(); //$NON-NLS-1$ + String lookup = "BKU." + bku.toString(); // String bkuName = Messages.getString(lookup); int i = this.bkuStrings.indexOf(bkuName); if (i == -1) { - log.warn("NO BKU match for {}", bkuName); //$NON-NLS-1$ + log.warn("NO BKU match for {}", bkuName); // return 0; } return i; } void performBKUSelectionChanged(BKUs selected) { - log.debug("Selected BKU: {}", selected); //$NON-NLS-1$ + log.debug("Selected BKU: {}", selected); // this.configurationContainer.setDefaultBKU(selected); this.cmbBKUAuswahl.select(this.getBKUElementIndex(selected)); } @@ -494,8 +494,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { BKUs bkuvalue = resolveBKU(selected); this.performBKUSelectionChanged(bkuvalue); } catch (Exception ex) { - log.error("Failed to parse BKU value: {} {}", selected, ex); //$NON-NLS-1$ - ErrorDialog dialog = new ErrorDialog(getShell(), Messages.getString("error.InvalidBKU"), BUTTONS.OK); //$NON-NLS-1$ + log.error("Failed to parse BKU value: {} {}", selected, ex); // + ErrorDialog dialog = new ErrorDialog(getShell(), Messages.getString("error.InvalidBKU"), BUTTONS.OK); // dialog.open(); } } @@ -504,7 +504,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { int blen = BKUs.values().length; for (int i = 0; i < blen; i++) { - String lookup = "BKU." + BKUs.values()[i].toString(); //$NON-NLS-1$ + String lookup = "BKU." + BKUs.values()[i].toString(); // if (Messages.getString(lookup).equals(localizedBKU)) { return BKUs.values()[i]; } @@ -516,23 +516,23 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { int getLocaleElementIndex(Locale locale) { for (int i = 0; i < Constants.SUPPORTED_LOCALES.length; i++) { if (Constants.SUPPORTED_LOCALES[i].equals(locale)) { - log.debug("Locale: {} IDX: {}", locale, i); //$NON-NLS-1$ //$NON-NLS-2$ + log.debug("Locale: {} IDX: {}", locale, i); // // return i; } } - log.warn("NO Locale match for {}", locale); //$NON-NLS-1$ + log.warn("NO Locale match for {}", locale); // return 0; } void performLocaleSelectionChanged(Locale selected) { - log.debug("Selected Locale: {}", selected); //$NON-NLS-1$ + log.debug("Selected Locale: {}", selected); // this.configurationContainer.setLocale(selected); this.cmbLocaleAuswahl.select(this.getLocaleElementIndex(selected)); } void performPositionSelection(boolean automatic) { - log.debug("Selected Position: {}", automatic); //$NON-NLS-1$ + log.debug("Selected Position: {}", automatic); // SignaturePosition pos = automatic ? new SignaturePosition() : null; this.configurationContainer.setDefaultSignaturePosition(pos); this.btnAutomatischePositionierung.setSelection(automatic); @@ -596,7 +596,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { } catch (Exception ex) { this.proxyHostErrorMarker.setVisible(true); this.proxyHostErrorMarker.setToolTipText(ex.getMessage()); - log.error("processProxyHost: ", ex); //$NON-NLS-1$ + log.error("processProxyHost: ", ex); // } } @@ -615,7 +615,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { } catch (Exception ex) { this.txtProxyPortErrorMarker.setVisible(true); this.txtProxyPortErrorMarker.setToolTipText(ex.getMessage()); - log.error("processProxyPort: ", ex); //$NON-NLS-1$ + log.error("processProxyPort: ", ex); // } } @@ -639,7 +639,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.composites.StateComposite#doLayout() */ @Override @@ -649,7 +649,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.composites.BaseConfigurationComposite#initConfiguration( * at.asit.pdfover.gui.workflow.config.PersistentConfigProvider) @@ -677,7 +677,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { try { this.configurationContainer.setProxyPort(provider.getProxyPortPersistent()); } catch (InvalidPortException e) { - log.error("Failed to set proxy port!", e); //$NON-NLS-1$ + log.error("Failed to set proxy port!", e); // } this.configurationContainer.setProxyUser(provider.getProxyUserPersistent()); this.configurationContainer.setProxyPass(provider.getProxyPassPersistent()); @@ -686,7 +686,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.composites.BaseConfigurationComposite#loadConfiguration() */ @@ -730,7 +730,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { /** * @param profile - * + * */ public void performSetSignatureProfile(Profile profile) { switch (profile) { @@ -748,7 +748,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.composites.BaseConfigurationComposite#storeConfiguration( * at.asit.pdfover.gui.workflow.config.ConfigManipulator, @@ -779,8 +779,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { if (hostOld != null && !hostOld.isEmpty() && (hostNew == null || hostNew.isEmpty())) { // Proxy has been removed, let's clear the system properties // Otherwise, the proxy settings wouldn't get removed - System.clearProperty("http.proxyHost"); //$NON-NLS-1$ - System.clearProperty("https.proxyHost"); //$NON-NLS-1$ + System.clearProperty("http.proxyHost"); // + System.clearProperty("https.proxyHost"); // } store.setProxyHost(hostNew); @@ -788,8 +788,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { int portNew = this.configurationContainer.getProxyPort(); if (portOld != -1 && portNew == -1) { // cf. above - System.clearProperty("http.proxyPort"); //$NON-NLS-1$ - System.clearProperty("https.proxyPort"); //$NON-NLS-1$ + System.clearProperty("http.proxyPort"); // + System.clearProperty("https.proxyPort"); // } store.setProxyPort(portNew); @@ -797,8 +797,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { String userNew = this.configurationContainer.getProxyUser(); if (userOld != null && !userOld.isEmpty() && (userNew == null || userNew.isEmpty())) { // cf. above - System.clearProperty("http.proxyUser"); //$NON-NLS-1$ - System.clearProperty("https.proxyUser"); //$NON-NLS-1$ + System.clearProperty("http.proxyUser"); // + System.clearProperty("https.proxyUser"); // } store.setProxyUser(userNew); @@ -806,15 +806,15 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { String passNew = this.configurationContainer.getProxyPass(); if (passOld != null && passNew == null) { // cf. above - System.clearProperty("http.proxyPassword"); //$NON-NLS-1$ - System.clearProperty("https.proxyPassword"); //$NON-NLS-1$ + System.clearProperty("http.proxyPassword"); // + System.clearProperty("https.proxyPassword"); // } store.setProxyPass(passNew); } /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.composites.BaseConfigurationComposite#validateSettings() */ @@ -851,62 +851,62 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.composites.StateComposite#reloadResources() */ @Override public void reloadResources() { - this.grpSignatur.setText(Messages.getString("advanced_config.Signature_Title")); //$NON-NLS-1$ - this.btnAutomatischePositionierung.setText(Messages.getString("advanced_config.AutoPosition")); //$NON-NLS-1$ - this.btnAutomatischePositionierung.setToolTipText(Messages.getString("advanced_config.AutoPosition_ToolTip")); //$NON-NLS-1$ - this.grpPlaceholder.setText(Messages.getString("advanced_config.Placeholder_Title")); //$NON-NLS-1$ - this.btnPlatzhalterVerwenden.setText(Messages.getString("advanced_config.UseMarker")); //$NON-NLS-1$ - this.btnPlatzhalterVerwenden.setToolTipText(Messages.getString("advanced_config.UseMarker_ToolTip")); //$NON-NLS-1$ - this.btnSignatureFieldsUsage.setText(Messages.getString("advanced_config.UseSignatureFields")); //$NON-NLS-1$ - this.btnSignatureFieldsUsage.setToolTipText(Messages.getString("advanced_config.UseSignatureFields_ToolTip")); //$NON-NLS-1$ + this.grpSignatur.setText(Messages.getString("advanced_config.Signature_Title")); // + this.btnAutomatischePositionierung.setText(Messages.getString("advanced_config.AutoPosition")); // + this.btnAutomatischePositionierung.setToolTipText(Messages.getString("advanced_config.AutoPosition_ToolTip")); // + this.grpPlaceholder.setText(Messages.getString("advanced_config.Placeholder_Title")); // + this.btnPlatzhalterVerwenden.setText(Messages.getString("advanced_config.UseMarker")); // + this.btnPlatzhalterVerwenden.setToolTipText(Messages.getString("advanced_config.UseMarker_ToolTip")); // + this.btnSignatureFieldsUsage.setText(Messages.getString("advanced_config.UseSignatureFields")); // + this.btnSignatureFieldsUsage.setToolTipText(Messages.getString("advanced_config.UseSignatureFields_ToolTip")); // this.btnEnablePlaceholderUsage.setText(Messages.getString("advanced_config.Placeholder_Enabled")); - this.btnPdfACompat.setText(Messages.getString("advanced_config.PdfACompat")); //$NON-NLS-1$ - this.btnPdfACompat.setToolTipText(Messages.getString("advanced_config.PdfACompat_ToolTip")); //$NON-NLS-1$ - this.lblTransparenz.setText(Messages.getString("advanced_config.SigPHTransparency")); //$NON-NLS-1$ - this.lblTransparenzLinks.setText(Messages.getString("advanced_config.SigPHTransparencyMin")); //$NON-NLS-1$ - this.lblTransparenzRechts.setText(Messages.getString("advanced_config.SigPHTransparencyMax")); //$NON-NLS-1$ - this.sclTransparenz.setToolTipText(Messages.getString("advanced_config.SigPHTransparencyTooltip")); //$NON-NLS-1$ - - this.grpBkuAuswahl.setText(Messages.getString("advanced_config.BKUSelection_Title")); //$NON-NLS-1$ - this.cmbBKUAuswahl.setToolTipText(Messages.getString("advanced_config.BKUSelection_ToolTip")); //$NON-NLS-1$ - this.btnKeystoreEnabled.setText(Messages.getString("advanced_config.KeystoreEnabled")); //$NON-NLS-1$ - this.btnKeystoreEnabled.setToolTipText(Messages.getString("advanced_config.KeystoreEnabled_ToolTip")); //$NON-NLS-1$ - - this.grpSpeicherort.setText(Messages.getString("advanced_config.OutputFolder_Title")); //$NON-NLS-1$ - this.lblDefaultOutputFolder.setText(Messages.getString("advanced_config.OutputFolder")); //$NON-NLS-1$ - this.txtOutputFolder.setToolTipText(Messages.getString("advanced_config.OutputFolder_ToolTip")); //$NON-NLS-1$ - this.btnBrowse.setText(Messages.getString("common.browse")); //$NON-NLS-1$ - - this.grpLocaleAuswahl.setText(Messages.getString("advanced_config.LocaleSelection_Title")); //$NON-NLS-1$ - this.cmbLocaleAuswahl.setToolTipText(Messages.getString("advanced_config.LocaleSelection_ToolTip")); //$NON-NLS-1$ - - this.grpUpdateCheck.setText(Messages.getString("advanced_config.UpdateCheck_Title")); //$NON-NLS-1$ - this.btnUpdateCheck.setText(Messages.getString("advanced_config.UpdateCheck")); //$NON-NLS-1$ - this.btnUpdateCheck.setToolTipText(Messages.getString("advanced_config.UpdateCheck_ToolTip")); //$NON-NLS-1$ - - this.grpProxy.setText(Messages.getString("advanced_config.Proxy_Title")); //$NON-NLS-1$ - this.lblProxyHost.setText(Messages.getString("advanced_config.ProxyHost")); //$NON-NLS-1$ - this.txtProxyHost.setToolTipText(Messages.getString("advanced_config.ProxyHost_ToolTip")); //$NON-NLS-1$ - this.txtProxyHost.setMessage(Messages.getString("advanced_config.ProxyHost_Template")); //$NON-NLS-1$ - this.lblProxyPort.setText(Messages.getString("advanced_config.ProxyPort")); //$NON-NLS-1$ - this.txtProxyPort.setToolTipText(Messages.getString("advanced_config.ProxyPort_ToolTip")); //$NON-NLS-1$ - this.txtProxyPort.setMessage(Messages.getString("advanced_config.ProxyPort_Template")); //$NON-NLS-1$ + this.btnPdfACompat.setText(Messages.getString("advanced_config.PdfACompat")); // + this.btnPdfACompat.setToolTipText(Messages.getString("advanced_config.PdfACompat_ToolTip")); // + this.lblTransparenz.setText(Messages.getString("advanced_config.SigPHTransparency")); // + this.lblTransparenzLinks.setText(Messages.getString("advanced_config.SigPHTransparencyMin")); // + this.lblTransparenzRechts.setText(Messages.getString("advanced_config.SigPHTransparencyMax")); // + this.sclTransparenz.setToolTipText(Messages.getString("advanced_config.SigPHTransparencyTooltip")); // + + this.grpBkuAuswahl.setText(Messages.getString("advanced_config.BKUSelection_Title")); // + this.cmbBKUAuswahl.setToolTipText(Messages.getString("advanced_config.BKUSelection_ToolTip")); // + this.btnKeystoreEnabled.setText(Messages.getString("advanced_config.KeystoreEnabled")); // + this.btnKeystoreEnabled.setToolTipText(Messages.getString("advanced_config.KeystoreEnabled_ToolTip")); // + + this.grpSpeicherort.setText(Messages.getString("advanced_config.OutputFolder_Title")); // + this.lblDefaultOutputFolder.setText(Messages.getString("advanced_config.OutputFolder")); // + this.txtOutputFolder.setToolTipText(Messages.getString("advanced_config.OutputFolder_ToolTip")); // + this.btnBrowse.setText(Messages.getString("common.browse")); // + + this.grpLocaleAuswahl.setText(Messages.getString("advanced_config.LocaleSelection_Title")); // + this.cmbLocaleAuswahl.setToolTipText(Messages.getString("advanced_config.LocaleSelection_ToolTip")); // + + this.grpUpdateCheck.setText(Messages.getString("advanced_config.UpdateCheck_Title")); // + this.btnUpdateCheck.setText(Messages.getString("advanced_config.UpdateCheck")); // + this.btnUpdateCheck.setToolTipText(Messages.getString("advanced_config.UpdateCheck_ToolTip")); // + + this.grpProxy.setText(Messages.getString("advanced_config.Proxy_Title")); // + this.lblProxyHost.setText(Messages.getString("advanced_config.ProxyHost")); // + this.txtProxyHost.setToolTipText(Messages.getString("advanced_config.ProxyHost_ToolTip")); // + this.txtProxyHost.setMessage(Messages.getString("advanced_config.ProxyHost_Template")); // + this.lblProxyPort.setText(Messages.getString("advanced_config.ProxyPort")); // + this.txtProxyPort.setToolTipText(Messages.getString("advanced_config.ProxyPort_ToolTip")); // + this.txtProxyPort.setMessage(Messages.getString("advanced_config.ProxyPort_Template")); // // this.lblProxyUser.setText(Messages.getString("advanced_config.ProxyUser")); - // //$NON-NLS-1$ + // // // this.txtProxyUser.setToolTipText(Messages - // .getString("advanced_config.ProxyUser_ToolTip")); //$NON-NLS-1$ + // .getString("advanced_config.ProxyUser_ToolTip")); // // this.txtProxyUser.setMessage(Messages - // .getString("advanced_config.ProxyUser_Template")); //$NON-NLS-1$ + // .getString("advanced_config.ProxyUser_Template")); // // this.lblProxyPass.setText(Messages.getString("advanced_config.ProxyPass")); - // //$NON-NLS-1$ + // // // this.txtProxyPass.setToolTipText(Messages - // .getString("advanced_config.ProxyPass_ToolTip")); //$NON-NLS-1$ + // .getString("advanced_config.ProxyPass_ToolTip")); // // this.txtProxyPass.setMessage(Messages - // .getString("advanced_config.ProxyPass_Template")); //$NON-NLS-1$ + // .getString("advanced_config.ProxyPass_Template")); // } } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/ConfigurationCompositeBase.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/ConfigurationCompositeBase.java index 81011f5e..5dfee07b 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/ConfigurationCompositeBase.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/ConfigurationCompositeBase.java @@ -29,17 +29,17 @@ import at.asit.pdfover.gui.workflow.states.State; * Base class for configuration composites */ public abstract class ConfigurationCompositeBase extends StateComposite { - + /** * the configuration container */ protected ConfigurationContainer configurationContainer; - + /** * The PDF Signer used to produce signature block preview */ protected PDFSigner signer; - + /** * @return the signer */ @@ -64,7 +64,7 @@ public abstract class ConfigurationCompositeBase extends StateComposite { * @param parent * @param style * @param state - * @param configuration + * @param configuration */ public ConfigurationCompositeBase(Composite parent, int style, State state, ConfigurationContainer configuration) { super(parent, style, state); @@ -92,12 +92,12 @@ public abstract class ConfigurationCompositeBase extends StateComposite { /** * Called before exit. * The method validates every setting in the configuration before exit - * + * * There might be settings when the user can decide to ignore a validation exception * (for example the Outputfolder validation) * In this case, the validator throws a ResumableException, which includes the * validator index to resume from (should the user choose to ignore the error) - * + * * @param resumeFrom Resume from this validator index (initially 0) * @throws Exception */ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java index afcca6ac..2400ac7e 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java @@ -62,7 +62,7 @@ import at.asit.pdfover.gui.workflow.states.State; import iaik.security.provider.IAIK; /** - * + * */ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { @@ -174,12 +174,12 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { FileDialog dialog = new FileDialog( KeystoreConfigurationComposite.this.getShell(), SWT.OPEN); dialog.setFilterExtensions(new String[] { - "*.p12;*.pkcs12;*.pfx;*.ks;*.jks", "*.p12;*.pkcs12;*.pfx;", "*.ks;*.jks*.", "*" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + "*.p12;*.pkcs12;*.pfx;*.ks;*.jks", "*.p12;*.pkcs12;*.pfx;", "*.ks;*.jks*.", "*" }); // // // // dialog.setFilterNames(new String[] { - Messages.getString("common.KeystoreExtension_Description"), //$NON-NLS-1$ - Messages.getString("common.PKCS12Extension_Description"), //$NON-NLS-1$ - Messages.getString("common.KSExtension_Description"), //$NON-NLS-1$ - Messages.getString("common.AllExtension_Description") }); //$NON-NLS-1$ + Messages.getString("common.KeystoreExtension_Description"), // + Messages.getString("common.PKCS12Extension_Description"), // + Messages.getString("common.KSExtension_Description"), // + Messages.getString("common.AllExtension_Description") }); // String fileName = dialog.open(); File file = null; if (fileName != null) { @@ -217,24 +217,24 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { try { loadKeystore(); } catch (KeyStoreException ex) { - log.error("Error loading keystore", ex); //$NON-NLS-1$ - showErrorDialog(Messages.getString("error.KeyStore")); //$NON-NLS-1$ + log.error("Error loading keystore", ex); // + showErrorDialog(Messages.getString("error.KeyStore")); // } catch (FileNotFoundException ex) { - log.error("Error loading keystore", ex); //$NON-NLS-1$ + log.error("Error loading keystore", ex); // showErrorDialog(String.format(Messages.getString( - "error.KeyStoreFileNotExist"), f.getName())); //$NON-NLS-1$ + "error.KeyStoreFileNotExist"), f.getName())); // } catch (NoSuchAlgorithmException ex) { - log.error("Error loading keystore", ex); //$NON-NLS-1$ - showErrorDialog(Messages.getString("error.KeyStore")); //$NON-NLS-1$ + log.error("Error loading keystore", ex); // + showErrorDialog(Messages.getString("error.KeyStore")); // } catch (CertificateException ex) { - log.error("Error loading keystore", ex); //$NON-NLS-1$ - showErrorDialog(Messages.getString("error.KeyStore")); //$NON-NLS-1$ + log.error("Error loading keystore", ex); // + showErrorDialog(Messages.getString("error.KeyStore")); // } catch (IOException ex) { - log.error("Error loading keystore", ex); //$NON-NLS-1$ - showErrorDialog(Messages.getString("error.KeyStore")); //$NON-NLS-1$ + log.error("Error loading keystore", ex); // + showErrorDialog(Messages.getString("error.KeyStore")); // } catch (NullPointerException ex) { - log.error("Error loading keystore - NPE?", ex); //$NON-NLS-1$ - showErrorDialog(Messages.getString("error.KeyStore")); //$NON-NLS-1$ + log.error("Error loading keystore - NPE?", ex); // + showErrorDialog(Messages.getString("error.KeyStore")); // } } }); @@ -278,7 +278,7 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { } void loadKeystore() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { - ConfigurationContainer config = + ConfigurationContainer config = KeystoreConfigurationComposite.this.configurationContainer; File f = new File(config.getKeyStoreFile()); this.ks = KeyStore.getInstance(config.getKeyStoreType()); @@ -292,37 +292,37 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { private void initKeystoreTypes() { this.keystoreTypes = new HashMap(); - this.keystoreTypes.put(Messages.getString("keystore_config.KeystoreType_PKCS12"), "PKCS12"); //$NON-NLS-1$ //$NON-NLS-2$ - this.keystoreTypes.put(Messages.getString("keystore_config.KeystoreType_JKS"), "JCEKS"); //$NON-NLS-1$ //$NON-NLS-2$ + this.keystoreTypes.put(Messages.getString("keystore_config.KeystoreType_PKCS12"), "PKCS12"); // // + this.keystoreTypes.put(Messages.getString("keystore_config.KeystoreType_JKS"), "JCEKS"); // // } /** - * @param fileName + * @param fileName */ protected void performKeystoreFileChanged(String fileName) { - log.debug("Selected keystore file: " + fileName); //$NON-NLS-1$ + log.debug("Selected keystore file: " + fileName); // this.configurationContainer.setKeyStoreFile(fileName); KeystoreConfigurationComposite.this.txtKeystoreFile.setText(fileName); int i = fileName.lastIndexOf('.'); if (i > 0) { String ext = fileName.substring(i+1); if ( - ext.equalsIgnoreCase("p12") || //$NON-NLS-1$ - ext.equalsIgnoreCase("pkcs12") || //$NON-NLS-1$ - ext.equalsIgnoreCase("pfx")) //$NON-NLS-1$ - performKeystoreTypeChanged("PKCS12"); //$NON-NLS-1$ + ext.equalsIgnoreCase("p12") || // + ext.equalsIgnoreCase("pkcs12") || // + ext.equalsIgnoreCase("pfx")) // + performKeystoreTypeChanged("PKCS12"); // else if ( - ext.equalsIgnoreCase("ks") || //$NON-NLS-1$ - ext.equalsIgnoreCase("jks")) //$NON-NLS-1$ - performKeystoreTypeChanged("JCEKS"); //$NON-NLS-1$ + ext.equalsIgnoreCase("ks") || // + ext.equalsIgnoreCase("jks")) // + performKeystoreTypeChanged("JCEKS"); // } } /** - * @param type + * @param type */ protected void performKeystoreTypeChanged(String type) { - log.debug("Selected keystore type: " + type); //$NON-NLS-1$ + log.debug("Selected keystore type: " + type); // this.configurationContainer.setKeyStoreType(type); for (int i = 0; i < this.cmbKeystoreType.getItemCount(); ++i) { if (this.keystoreTypes.get(this.cmbKeystoreType.getItem(i)).equals(type)) { @@ -333,10 +333,10 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { } /** - * @param storepass + * @param storepass */ protected void performKeystoreStorePassChanged(String storepass) { - log.debug("Changed keystore store password"); //$NON-NLS-1$ + log.debug("Changed keystore store password"); // this.configurationContainer.setKeyStoreStorePass(storepass); this.txtKeystoreStorePass.setText(storepass); } @@ -345,23 +345,23 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { * @param alias */ protected void performKeystoreAliasChanged(String alias) { - log.debug("Selected keystore alias: " + alias); //$NON-NLS-1$ + log.debug("Selected keystore alias: " + alias); // this.configurationContainer.setKeyStoreAlias(alias); this.cmbKeystoreAlias.setText(alias); } /** - * @param keypass + * @param keypass */ protected void performKeystoreKeyPassChanged(String keypass) { - log.debug("Changed keystore key password"); //$NON-NLS-1$ + log.debug("Changed keystore key password"); // this.configurationContainer.setKeyStoreKeyPass(keypass); this.txtKeystoreKeyPass.setText(keypass); } /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.composites.BaseConfigurationComposite#signerChanged() */ @@ -372,7 +372,7 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.composites.StateComposite#doLayout() */ @Override @@ -412,7 +412,7 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { if (ksf.exists()) loadKeystore(); } catch (Exception e) { - log.error("Error loading keystore", e); //$NON-NLS-1$ + log.error("Error loading keystore", e); // } performKeystoreAliasChanged(config.getKeyStoreAlias()); performKeystoreKeyPassChanged(config.getKeyStoreKeyPass()); @@ -434,7 +434,7 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.composites.BaseConfigurationComposite#validateSettings * () @@ -478,24 +478,24 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.composites.StateComposite#reloadResources() */ @Override public void reloadResources() { - this.grpKeystore.setText(Messages.getString("keystore_config.Keystore_Title")); //$NON-NLS-1$ - this.lblKeystoreFile.setText(Messages.getString("keystore_config.KeystoreFile")); //$NON-NLS-1$ - this.btnBrowse.setText(Messages.getString("common.browse")); //$NON-NLS-1$ - this.txtKeystoreFile.setToolTipText(Messages.getString("keystore_config.KeystoreFile_ToolTip")); //$NON-NLS-1$ - this.lblKeystoreType.setText(Messages.getString("keystore_config.KeystoreType")); //$NON-NLS-1$ + this.grpKeystore.setText(Messages.getString("keystore_config.Keystore_Title")); // + this.lblKeystoreFile.setText(Messages.getString("keystore_config.KeystoreFile")); // + this.btnBrowse.setText(Messages.getString("common.browse")); // + this.txtKeystoreFile.setToolTipText(Messages.getString("keystore_config.KeystoreFile_ToolTip")); // + this.lblKeystoreType.setText(Messages.getString("keystore_config.KeystoreType")); // initKeystoreTypes(); this.cmbKeystoreType.setItems(this.keystoreTypes.keySet().toArray(new String[0])); - this.lblKeystoreStorePass.setText(Messages.getString("keystore_config.KeystoreStorePass")); //$NON-NLS-1$ - this.txtKeystoreStorePass.setToolTipText(Messages.getString("keystore_config.KeystoreStorePass_ToolTip")); //$NON-NLS-1$ - this.btnLoad.setText(Messages.getString("keystore_config.Load")); //$NON-NLS-1$ - this.btnLoad.setToolTipText(Messages.getString("keystore_config.Load_ToolTip")); //$NON-NLS-1$ - this.lblKeystoreAlias.setText(Messages.getString("keystore_config.KeystoreAlias")); //$NON-NLS-1$ - this.lblKeystoreKeyPass.setText(Messages.getString("keystore_config.KeystoreKeyPass")); //$NON-NLS-1$ - this.txtKeystoreKeyPass.setToolTipText(Messages.getString("keystore_config.KeystoreKeyPass_ToolTip")); //$NON-NLS-1$ + this.lblKeystoreStorePass.setText(Messages.getString("keystore_config.KeystoreStorePass")); // + this.txtKeystoreStorePass.setToolTipText(Messages.getString("keystore_config.KeystoreStorePass_ToolTip")); // + this.btnLoad.setText(Messages.getString("keystore_config.Load")); // + this.btnLoad.setToolTipText(Messages.getString("keystore_config.Load_ToolTip")); // + this.lblKeystoreAlias.setText(Messages.getString("keystore_config.KeystoreAlias")); // + this.lblKeystoreKeyPass.setText(Messages.getString("keystore_config.KeystoreKeyPass")); // + this.txtKeystoreKeyPass.setToolTipText(Messages.getString("keystore_config.KeystoreKeyPass_ToolTip")); // } } 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 a2973c3d..edf7894f 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 @@ -72,7 +72,7 @@ import at.asit.pdfover.signator.SignatureParameter; import at.asit.pdfover.signator.SignaturePosition; /** - * + * */ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { @@ -105,12 +105,12 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { protected String logoFile = null; protected Image sigPreview = null; protected Image logo = null; - + protected final Group grpSignatureProfile; protected final Combo cmbSignatureProfiles; - + /** * @param parent @@ -162,7 +162,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { StateComposite.anchor(grpSignatureProfile).right(100,-5).left(0,5).top(grpHandySignatur, 5).set(); this.grpSignatureProfile.setLayout(new FormLayout()); StateComposite.setFontHeight(grpSignatureProfile, Constants.TEXT_SIZE_NORMAL); - + this.cmbSignatureProfiles = new Combo(this.grpSignatureProfile, SWT.READ_ONLY); StateComposite.anchor(cmbSignatureProfiles).left(0,10).right(100,-10).top(0,10).bottom(100,-10).set(); StateComposite.setFontHeight(cmbSignatureProfiles, Constants.TEXT_SIZE_NORMAL); @@ -233,7 +233,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { // Only taking first file ... File file = new File(files[0]); if (!file.exists()) { - log.error("File: {} does not exist!", files[0]); //$NON-NLS-1$//$NON-NLS-2$ + log.error("File: {} does not exist!", files[0]); //// return; } processEmblemChanged(file.getAbsolutePath()); @@ -392,11 +392,11 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { } /** - * + * */ private final class ImageFileBrowser extends SelectionAdapter { /** - * + * */ public ImageFileBrowser() { // Nothing to do @@ -407,13 +407,13 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { FileDialog dialog = new FileDialog( SimpleConfigurationComposite.this.getShell(), SWT.OPEN); dialog.setFilterExtensions(new String[] { - "*.jpg;*.png;*.gif", "*.jpg", "*.png", "*.gif", "*" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + "*.jpg;*.png;*.gif", "*.jpg", "*.png", "*.gif", "*" }); // // // // // dialog.setFilterNames(new String[] { - Messages.getString("common.ImageExtension_Description"), //$NON-NLS-1$ - Messages.getString("common.JPGExtension_Description"), //$NON-NLS-1$ - Messages.getString("common.PNGExtension_Description"), //$NON-NLS-1$ - Messages.getString("common.GIFExtension_Description"), //$NON-NLS-1$ - Messages.getString("common.AllExtension_Description") }); //$NON-NLS-1$ + Messages.getString("common.ImageExtension_Description"), // + Messages.getString("common.JPGExtension_Description"), // + Messages.getString("common.PNGExtension_Description"), // + Messages.getString("common.GIFExtension_Description"), // + Messages.getString("common.AllExtension_Description") }); // String fileName = dialog.open(); File file = null; if (fileName != null) { @@ -447,9 +447,9 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { if (this.signer != null) { SignatureParameter param = this.signer.getPDFSigner().newParameter(); if(this.configurationContainer.getSignatureNote() != null && !this.configurationContainer.getSignatureNote().isEmpty()) { - param.setProperty("SIG_NOTE", this.configurationContainer.getSignatureNote()); //$NON-NLS-1$ + param.setProperty("SIG_NOTE", this.configurationContainer.getSignatureNote()); // } - + param.setSignatureLanguage(this.configurationContainer.getSignatureLocale().getLanguage()); param.setSignaturePdfACompat(this.configurationContainer.getSignaturePdfACompat()); if (image != null && !image.trim().isEmpty()) { @@ -461,7 +461,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { //img = SignaturePlaceholderCache.getSWTPlaceholder(param); } } catch (Exception e) { - log.error("Failed to load image for display...", e); //$NON-NLS-1 + log.error("Failed to load image for display...", e); } if (img != null) { @@ -477,7 +477,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { ImageConverter.convertToSWT(CachedFileNameEmblem.fixImage( ImageIO.read(imgFile), imgFile))); } catch (IOException e) { - log.error("Error reading image", e); //$NON-NLS-1$ + log.error("Error reading image", e); // } } else { this.logo = null; @@ -491,10 +491,10 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { try { setEmblemFileInternal(filename, false); } catch (Exception ex) { - log.error("processEmblemChanged: ", ex); //$NON-NLS-1$ + log.error("processEmblemChanged: ", ex); // ErrorDialog dialog = new ErrorDialog( getShell(), - Messages.getString("error.FailedToLoadEmblem"), BUTTONS.OK); //$NON-NLS-1$ + Messages.getString("error.FailedToLoadEmblem"), BUTTONS.OK); // dialog.open(); } } @@ -506,8 +506,8 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { } catch (Exception ex) { this.txtMobileNumberErrorMarker.setVisible(true); this.txtMobileNumberErrorMarker.setToolTipText(Messages - .getString("error.InvalidPhoneNumber")); //$NON-NLS-1$ - log.error("processNumberChanged: ", ex); //$NON-NLS-1$ + .getString("error.InvalidPhoneNumber")); // + log.error("processNumberChanged: ", ex); // this.redraw(); this.doLayout(); } @@ -516,17 +516,17 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { int getLocaleElementIndex(Locale locale) { for (int i = 0; i < Constants.SUPPORTED_LOCALES.length; i++) { if (Constants.SUPPORTED_LOCALES[i].equals(locale)) { - log.debug("Locale: {} IDX: {}",locale, i); //$NON-NLS-1$ //$NON-NLS-2$ + log.debug("Locale: {} IDX: {}",locale, i); // // return i; } } - log.warn("NO Locale match for {}", locale); //$NON-NLS-1$ + log.warn("NO Locale match for {}", locale); // return 0; } void performSignatureLangSelectionChanged(Locale selected, Locale previous) { - log.debug("Selected Sign Locale: {}", selected); //$NON-NLS-1$ + log.debug("Selected Sign Locale: {}", selected); // this.configurationContainer.setSignatureLocale(selected); this.cmbSignatureLang.select(this.getLocaleElementIndex(selected)); @@ -535,9 +535,9 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { } - + void preformProfileSelectionChanged(Profile newProfile) { - log.debug("Signature Profile {} was selected", newProfile.name()); //$NON-NLS-1$ + log.debug("Signature Profile {} was selected", newProfile.name()); // Profile oldProfile = this.configurationContainer.getSignatureProfile(); this.configurationContainer.setSignatureProfile(newProfile); this.cmbSignatureProfiles.select(newProfile.ordinal()); @@ -574,7 +574,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.composites.BaseConfigurationComposite#signerChanged() */ @@ -589,7 +589,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { this.configurationContainer.setMobileNumber(number); number = this.configurationContainer.getMobileNumber(); if (number == null) { - this.txtMobileNumber.setText(""); //$NON-NLS-1$ + this.txtMobileNumber.setText(""); // return; } this.txtMobileNumber.setText(number); @@ -602,7 +602,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.composites.StateComposite#doLayout() */ @Override @@ -623,7 +623,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { this.configurationContainer.setEmblem( provider.getDefaultEmblemPersistent()); } catch (InvalidEmblemFile e) { - log.error("Failed to set emblem!", e); //$NON-NLS-1$ + log.error("Failed to set emblem!", e); // } this.configurationContainer.setSignatureLocale( @@ -653,10 +653,10 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { setEmblemFileInternal(emblemFile, true); this.btnClearImage.setSelection(true); } catch (Exception e1) { - log.error("Failed to load emblem: ", e1); //$NON-NLS-1$ + log.error("Failed to load emblem: ", e1); // ErrorDialog dialog = new ErrorDialog( getShell(), - Messages.getString("error.FailedToLoadEmblem"), BUTTONS.OK); //$NON-NLS-1$ + Messages.getString("error.FailedToLoadEmblem"), BUTTONS.OK); // dialog.open(); } } @@ -670,9 +670,9 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { this.setVisibleImage(); this.performSignatureLangSelectionChanged(this.configurationContainer.getSignatureLocale(), null); - + this.preformProfileSelectionChanged(this.configurationContainer.getSignatureProfile()); - + } /* (non-Javadoc) @@ -688,7 +688,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { store.setSignatureLocale(this.configurationContainer.getSignatureLocale()); store.setSignatureNote(this.configurationContainer.getSignatureNote()); - + store.setSignatureProfile(this.configurationContainer.getSignatureProfile().name()); @@ -696,7 +696,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see * at.asit.pdfover.gui.composites.BaseConfigurationComposite#validateSettings * () @@ -717,7 +717,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { /* * (non-Javadoc) - * + * * @see at.asit.pdfover.gui.composites.StateComposite#reloadResources() */ @Override -- cgit v1.2.3