diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-02-18 13:32:09 +0100 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-02-18 13:32:09 +0100 |
commit | b8295c8f0cf1131888f65a03b30307cd27a34c14 (patch) | |
tree | 50047909922e806d49fb1449285b584246b5b4a5 /pdf-over-gui/src/main/java | |
parent | b8deac65b30f52f2bd502f04b985a95744c4e4e1 (diff) | |
download | pdf-over-b8295c8f0cf1131888f65a03b30307cd27a34c14.tar.gz pdf-over-b8295c8f0cf1131888f65a03b30307cd27a34c14.tar.bz2 pdf-over-b8295c8f0cf1131888f65a03b30307cd27a34c14.zip |
refactor getDefaultSignatureBlockNote to not be static
Diffstat (limited to 'pdf-over-gui/src/main/java')
2 files changed, 8 insertions, 8 deletions
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 44dcafc5..fc844ef3 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 @@ -537,9 +537,9 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { this.cmbSignatureLang.select(this.getLocaleElementIndex(selected)); if (previous != null) { Profile profile = Profile.values()[this.cmbSignatureProfiles.getSelectionIndex()]; - String prev_default_note = getSignatureBlockNoteTextAccordingToProfile(profile, previous); + String prev_default_note = profile.getDefaultSignatureBlockNote(previous); if (this.txtSignatureNote.getText().equals(prev_default_note)) { - this.txtSignatureNote.setText(getSignatureBlockNoteTextAccordingToProfile(profile, selected)); //$NON-NLS-1$); + this.txtSignatureNote.setText(profile.getDefaultSignatureBlockNote(selected)); processSignatureNoteChanged(); } } @@ -575,10 +575,10 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { String note = this.txtSignatureNote.getText(); note = note.replace("!",""); - if (note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.AMTSSIGNATURBLOCK, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())) || - note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.SIGNATURBLOCK_SMALL, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())) || - note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.INVISIBLE, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())) || - note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.BASE_LOGO, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale()))){ + if (note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.AMTSSIGNATURBLOCK, configurationContainer.getSignatureLocale())) || + note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.SIGNATURBLOCK_SMALL, configurationContainer.getSignatureLocale())) || + note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.INVISIBLE, configurationContainer.getSignatureLocale())) || + note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.BASE_LOGO, configurationContainer.getSignatureLocale()))){ return false; } return true; @@ -587,7 +587,7 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { String getSignatureBlockNoteTextAccordingToProfile(Profile profile, Locale signatureLocale){ - return Profile.getSignatureBlockNoteTextAccordingToProfile(profile, this.configurationContainer.getSignatureLocale()); + return profile.getDefaultSignatureBlockNote(configurationContainer.getSignatureLocale()); } void setSignatureProfileSetting(){ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java index acea5f09..21343b5b 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java @@ -157,7 +157,7 @@ public class PrepareConfigurationState extends State { private void resetSignatureNoteField(ConfigProvider config){ getStateMachine().getConfigManipulator().setSignatureNote( - Profile.getSignatureBlockNoteTextAccordingToProfile(Profile.getProfile(config.getSignatureProfile()), config.getLocale()) + Profile.getProfile(config.getSignatureProfile()).getDefaultSignatureBlockNote(config.getLocale()) ); } |