diff options
author | Andreas Abraham <andreas.abraham@egiz.gv.at> | 2020-11-19 16:30:36 +0100 |
---|---|---|
committer | Andreas Abraham <andreas.abraham@egiz.gv.at> | 2020-11-19 16:30:36 +0100 |
commit | 402805f8485a926a8efd8d01de9af98824941140 (patch) | |
tree | 61295d092a1d3c654eafd23a08105780c2a9b525 /pdf-over-gui/src/main/java/at | |
parent | 0ac178bebfeed95af88de462f2c463f7569be9dd (diff) | |
download | pdf-over-402805f8485a926a8efd8d01de9af98824941140.tar.gz pdf-over-402805f8485a926a8efd8d01de9af98824941140.tar.bz2 pdf-over-402805f8485a926a8efd8d01de9af98824941140.zip |
Added Postfix option to the configuration
Diffstat (limited to 'pdf-over-gui/src/main/java/at')
6 files changed, 35 insertions, 16 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java index 17a9a8d7..1fa31abb 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java @@ -41,8 +41,9 @@ public class Constants { public static final String APP_NAME_VERSION = (APP_VERSION == null ? APP_NAME : APP_NAME + " v" + APP_VERSION); //$NON-NLS-1$ public static final String SIGNATURE_PROFILE = "SIGNATURE_PROFILE"; //$NON-NLS-1$ + public static final String DEFAULT_POSTFIX = "_signed"; - static { + static { // Has to be set before (implicitly) initializing Display Display.setAppName(APP_NAME); } @@ -209,6 +210,8 @@ public class Constants { /** The output folder config parameter */ public static final String CFG_OUTPUT_FOLDER = "OUTPUT_FOLDER"; //$NON-NLS-1$ + public static final String CFG_POSTFIX = "SAVE_FILE_POSTFIX"; + /** The main window size (Format: width,height) */ public static final String CFG_MAINWINDOW_SIZE = "MAINWINDOW_SIZE"; //$NON-NLS-1$ 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 0cb26983..8ed1b640 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 @@ -869,6 +869,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.configurationContainer.setKeyStoreEnabled(provider.getKeyStoreEnabledPersistent()); this.configurationContainer.setOutputFolder(provider.getDefaultOutputFolderPersistent()); + this.configurationContainer.setSaveFilePostFix(provider.getSaveFilePostFix()); this.configurationContainer.setLocale(provider.getLocale()); @@ -899,6 +900,12 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { if (outputFolder != null) { performOutputFolderChanged(outputFolder); } + String postFix = this.configurationContainer.getSaveFilePostFix(); + if (postFix != null) { + performPostFixChanged(postFix); + } else { + performPostFixChanged(Constants.DEFAULT_POSTFIX); + } SignaturePosition pos = this.configurationContainer.getDefaultSignaturePosition(); performPositionSelection(pos != null && pos.useAutoPositioning()); performUseMarkerSelection(this.configurationContainer.getUseMarker()); @@ -963,7 +970,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { store.setKeyStoreEnabled(this.configurationContainer.getKeyStoreEnabled()); store.setDefaultOutputFolder(this.configurationContainer.getOutputFolder()); - + store.setSaveFilePostFix(this.configurationContainer.getSaveFilePostFix()); store.setLocale(this.configurationContainer.getLocale()); store.setUpdateCheck(this.configurationContainer.getUpdateCheck()); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigManipulator.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigManipulator.java index 3aba5075..befb244b 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigManipulator.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigManipulator.java @@ -201,7 +201,9 @@ public interface ConfigManipulator { /** * @param profile */ - void setSignatureProfile(String profile); + public void setSignatureProfile(String profile); + + public void setSaveFilePostFix(String postFix); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java index efe0a83b..b6935206 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProvider.java @@ -276,6 +276,8 @@ public interface ConfigProvider { * @return */ public String getSignatureProfile(); + + public String getSaveFilePostFix(); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java index 92a64103..9dc19be4 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java @@ -114,6 +114,8 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, setDefaultOutputFolder(config .getProperty(Constants.CFG_OUTPUT_FOLDER)); + setSaveFilePostFix(config.getProperty(Constants.CFG_POSTFIX)); + String localeString = config.getProperty(Constants.CFG_LOCALE); Locale targetLocale = LocaleSerializer.parseFromString(localeString); @@ -351,6 +353,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, props.setProperty(Constants.CFG_SIGNATURE_NOTE, getSignatureNote()); props.setProperty(Constants.CFG_MOBILE_NUMBER, getDefaultMobileNumberPersistent()); props.setProperty(Constants.CFG_OUTPUT_FOLDER, getDefaultOutputFolderPersistent()); + props.setProperty(Constants.CFG_POSTFIX, getSaveFilePostFix()); props.setProperty(Constants.CFG_SIGNATURE_PLACEHOLDER_TRANSPARENCY, Integer.toString(getPlaceholderTransparency())); @@ -985,16 +988,6 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, } } - - /*@Override - public void setDefaultDownloadURL(String downloadURL) { - if (downloadURL == null || downloadURL.trim().isEmpty()) { - this.configuration.setDownloadURL(Constants.CERTIFICATE_DOWNLOAD_XML_URL+Constants.CERTIFICATE_XML_FILE); - } else { - this.configuration.setDownloadURL(downloadURL); - } - } - /* (non-Javadoc) * @see at.asit.pdfover.gui.workflow.ConfigOverlayManipulator#setDefaultOutputFolderOverlay(java.lang.String) */ @@ -1510,8 +1503,18 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator, public void setSignatureProfile(String profile) { this.configurationOverlay.setSignatureProfile(Profile.getProfile(profile)); } - - @Override + + @Override + public void setSaveFilePostFix(String postFix) { + this.configurationOverlay.setSaveFilePostFix(postFix); + } + + @Override + public String getSaveFilePostFix(){ + return this.configurationOverlay.getSaveFilePostFix(); + } + + @Override public String getSignatureProfile() { return this.configurationOverlay.getSignatureProfile().getName(); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/PersistentConfigProvider.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/PersistentConfigProvider.java index 3304b6ca..1175ca9a 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/PersistentConfigProvider.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/PersistentConfigProvider.java @@ -204,5 +204,7 @@ public interface PersistentConfigProvider { * * @return the signature profile */ - public String getSignatureProfile(); + public String getSignatureProfile(); + + public String getSaveFilePostFix(); } |