diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-07-07 12:57:59 +0200 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-07-07 12:57:59 +0200 |
commit | 3c1e373f9fdf83da4b2083101c77a664ea756091 (patch) | |
tree | 006f866de8ffc24d3bab5fb1a37a1d17ea1d6ec2 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration | |
parent | 5555d3c73c2b4b9e1f9341be9053dde91a02af6a (diff) | |
download | pdf-over-3c1e373f9fdf83da4b2083101c77a664ea756091.tar.gz pdf-over-3c1e373f9fdf83da4b2083101c77a664ea756091.tar.bz2 pdf-over-3c1e373f9fdf83da4b2083101c77a664ea756091.zip |
YAGNI: the four different Config* interfaces that are only implemented once
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration')
5 files changed, 10 insertions, 38 deletions
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 6377a548..7eac256a 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 @@ -22,7 +22,6 @@ import at.asit.pdfover.commons.Constants; import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.composites.StateComposite; import at.asit.pdfover.gui.workflow.config.ConfigProviderImpl; -import at.asit.pdfover.gui.workflow.config.PersistentConfigProvider; public class AboutComposite extends ConfigurationCompositeBase { static final Logger log = LoggerFactory.getLogger(AboutComposite.class); @@ -138,7 +137,7 @@ public class AboutComposite extends ConfigurationCompositeBase { protected void signerChanged() {} @Override - public void initConfiguration(PersistentConfigProvider provider) {} + public void initConfiguration(ConfigProviderImpl provider) {} @Override public void loadConfiguration() {} 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 f8e8eb5a..baba386a 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 @@ -55,7 +55,6 @@ import at.asit.pdfover.gui.exceptions.OutputfolderDoesntExistException; import at.asit.pdfover.gui.exceptions.OutputfolderNotADirectoryException; import at.asit.pdfover.gui.workflow.config.ConfigProviderImpl; import at.asit.pdfover.gui.workflow.config.ConfigurationContainer; -import at.asit.pdfover.gui.workflow.config.PersistentConfigProvider; import at.asit.pdfover.gui.workflow.states.State; import at.asit.pdfover.signator.BKUs; import at.asit.pdfover.signator.SignaturePosition; @@ -647,15 +646,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { // Nothing to do here } - /* - * (non-Javadoc) - * - * @see - * at.asit.pdfover.gui.composites.BaseConfigurationComposite#initConfiguration( - * at.asit.pdfover.gui.workflow.config.PersistentConfigProvider) - */ @Override - public void initConfiguration(PersistentConfigProvider provider) { + public void initConfiguration(ConfigProviderImpl provider) { this.configurationContainer.defaultSignaturePosition = provider.getDefaultSignaturePositionPersistent(); this.configurationContainer.setUseMarker(provider.getUseMarker()); this.configurationContainer.setUseSignatureFields(provider.getUseSignatureFields()); 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 2c871e3e..d3e458db 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 @@ -22,7 +22,6 @@ import at.asit.pdfover.gui.composites.StateComposite; import at.asit.pdfover.gui.workflow.PDFSigner; import at.asit.pdfover.gui.workflow.config.ConfigProviderImpl; import at.asit.pdfover.gui.workflow.config.ConfigurationContainer; -import at.asit.pdfover.gui.workflow.config.PersistentConfigProvider; import at.asit.pdfover.gui.workflow.states.State; /** @@ -72,10 +71,10 @@ public abstract class ConfigurationCompositeBase extends StateComposite { } /** - * Initialize ConfigurationContainer from PersistentConfigProvider - * @param provider the PersistentConfigProvider to load config from + * Initialize ConfigurationContainer from ConfigProviderImpl + * @param provider the ConfigProviderImpl to load config from */ - public abstract void initConfiguration(PersistentConfigProvider provider); + public abstract void initConfiguration(ConfigProviderImpl provider); /** * Load configuration from ConfigurationContainer @@ -84,7 +83,7 @@ public abstract class ConfigurationCompositeBase extends StateComposite { /** * Store configuration from ConfigurationContainer to ConfigProvider - * @param store the ConfigProvider to store config to + * @param store the ConfigProviderImpl to store config to */ public abstract void storeConfiguration(ConfigProviderImpl store); 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 dba585fa..597112df 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 @@ -57,7 +57,6 @@ import at.asit.pdfover.gui.exceptions.KeystoreKeyPasswordException; import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.config.ConfigProviderImpl; import at.asit.pdfover.gui.workflow.config.ConfigurationContainer; -import at.asit.pdfover.gui.workflow.config.PersistentConfigProvider; import at.asit.pdfover.gui.workflow.states.State; import iaik.security.provider.IAIK; @@ -380,12 +379,8 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { layout(true, true); } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#initConfiguration(at.asit.pdfover.gui.workflow.config.PersistentConfigProvider) - */ @Override - public void initConfiguration(PersistentConfigProvider provider) { + public void initConfiguration(ConfigProviderImpl provider) { ConfigurationContainer config = this.configurationContainer; config.keystoreFile = provider.getKeyStoreFilePersistent(); config.keystoreType = provider.getKeyStoreTypePersistent(); @@ -418,9 +413,6 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { performKeystoreKeyPassChanged(config.keystoreKeyPass); } - /* (non-Javadoc) - * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#storeConfiguration(at.asit.pdfover.gui.workflow.config.ConfigManipulator, at.asit.pdfover.gui.workflow.config.PersistentConfigProvider) - */ @Override public void storeConfiguration(ConfigProviderImpl store) { ConfigurationContainer config = this.configurationContainer; 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 49a9260f..257f9cc6 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 @@ -65,7 +65,6 @@ import at.asit.pdfover.gui.exceptions.InvalidEmblemFile; import at.asit.pdfover.gui.utils.ImageConverter; import at.asit.pdfover.gui.workflow.config.ConfigProviderImpl; import at.asit.pdfover.gui.workflow.config.ConfigurationContainer; -import at.asit.pdfover.gui.workflow.config.PersistentConfigProvider; import at.asit.pdfover.gui.workflow.states.State; import at.asit.pdfover.signator.CachedFileNameEmblem; import at.asit.pdfover.signator.SignatureParameter; @@ -607,18 +606,12 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { layout(true, true); } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#initConfiguration(at.asit.pdfover.gui.workflow.config.PersistentConfigProvider) - */ @Override - public void initConfiguration(PersistentConfigProvider provider) { - this.configurationContainer.setMobileNumber( - provider.getDefaultMobileNumberPersistent()); + public void initConfiguration(ConfigProviderImpl provider) { + this.configurationContainer.setMobileNumber(provider.getDefaultMobileNumberPersistent()); try { - this.configurationContainer.setEmblem( - provider.getDefaultEmblemPersistent()); + this.configurationContainer.setEmblem(provider.getDefaultEmblemPersistent()); } catch (InvalidEmblemFile e) { log.error("Failed to set emblem!", e); } @@ -669,9 +662,6 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { } - /* (non-Javadoc) - * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#storeConfiguration(at.asit.pdfover.gui.workflow.config.ConfigManipulator, at.asit.pdfover.gui.workflow.config.PersistentConfigProvider) - */ @Override public void storeConfiguration(ConfigProviderImpl store) { store.setDefaultMobileNumber(this.configurationContainer.getMobileNumber()); |