From 17a8b0011e749af61fa41afdc221169a579ac688 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Tue, 10 Nov 2020 13:51:09 +0100 Subject: added signature profile to the config --- .../at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 bbcf6b9c..fe4cfc28 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 @@ -1183,6 +1183,8 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { store.setLocale(this.configurationContainer.getLocale()); store.setUpdateCheck(this.configurationContainer.getUpdateCheck()); + + store.setSignatureProfile(this.configurationContainer.getSignatureProfile().getName()); String hostOld = provider.getProxyHostPersistent(); String hostNew = this.configurationContainer.getProxyHost(); -- cgit v1.2.3 From 0b920b2d10e7844f4ba2f02e0191438808d8d4e0 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Wed, 11 Nov 2020 15:32:36 +0100 Subject: fixed bug in configuration --- .../composites/AdvancedConfigurationComposite.java | 180 ++------------------- 1 file changed, 13 insertions(+), 167 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 fe4cfc28..e9ed5316 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 @@ -48,6 +48,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.Constants; +import at.asit.pdfover.gui.Constants.PROFILE; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.controls.ErrorMarker; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; @@ -113,12 +114,6 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { private Label lblProxyPort; private Text txtProxyPort; private ErrorMarker txtProxyPortErrorMarker; -// private Label lblProxyUser; -// private Text txtProxyUser; -// private ErrorMarker proxyUserErrorMarker; -// private Label lblProxyPass; -// private Text txtProxyPass; -// private ErrorMarker proxyPassErrorMarker; FormData fd_txtProxyPort; FormData fd_txtProxyPortErrorMarker; @@ -719,119 +714,6 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { processProxyPortChanged(); } }); - -// this.lblProxyUser = new Label(this.grpProxy, SWT.NONE); -// GridData gd_lblProxyUser = new GridData(SWT.LEFT, SWT.CENTER, false, -// false, 1, 1); -// gd_lblProxyUser.widthHint = 80; -// this.lblProxyUser.setLayoutData(gd_lblProxyUser); -// this.lblProxyUser.setBounds(0, 0, 57, 15); -// -// FontData[] fD_lblProxyUser = this.lblProxyUser.getFont().getFontData(); -// fD_lblProxyUser[0].setHeight(Constants.TEXT_SIZE_NORMAL); -// this.lblProxyUser.setFont(new Font(Display.getCurrent(), -// fD_lblProxyUser[0])); -// -// Composite compProxyUserContainer = new Composite(this.grpProxy, SWT.NONE); -// compProxyUserContainer.setLayout(new FormLayout()); -// compProxyUserContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, -// 1, 1)); -// this.txtProxyUser = new Text(compProxyUserContainer, SWT.BORDER); -// FormData fd_txtProxyUser = new FormData(); -// fd_txtProxyUser.right = new FormAttachment(100, -42); -// fd_txtProxyUser.top = new FormAttachment(0); -// fd_txtProxyUser.left = new FormAttachment(0, 5); -// -// FontData[] fD_txtProxyUser = this.txtProxyUser.getFont().getFontData(); -// fD_txtProxyUser[0].setHeight(Constants.TEXT_SIZE_NORMAL); -// this.txtProxyUser.setFont(new Font(Display.getCurrent(), -// fD_txtProxyUser[0])); -// -// this.proxyUserErrorMarker = new ErrorMarker(compProxyUserContainer, SWT.NONE, ""); //$NON-NLS-1$ -// -// FormData fd_proxyUserErrorMarker = new FormData(); -// fd_proxyUserErrorMarker.left = new FormAttachment(100, -32); -// fd_proxyUserErrorMarker.right = new FormAttachment(100); -// fd_proxyUserErrorMarker.top = new FormAttachment(0); -// fd_proxyUserErrorMarker.bottom = new FormAttachment(0, 32); -// -// this.proxyUserErrorMarker.setLayoutData(fd_proxyUserErrorMarker); -// this.proxyUserErrorMarker.setVisible(false); -// this.txtProxyUser.setLayoutData(fd_txtProxyUser); -// -// this.txtProxyUser.addFocusListener(new FocusAdapter() { -// -// @Override -// public void focusLost(FocusEvent e) { -// processProxyUserChanged(); -// } -// }); -// -// this.txtProxyUser.addTraverseListener(new TraverseListener() { -// -// @Override -// public void keyTraversed(TraverseEvent e) { -// if (e.detail == SWT.TRAVERSE_RETURN) { -// processProxyUserChanged(); -// } -// } -// }); -// -// this.lblProxyPass = new Label(this.grpProxy, SWT.NONE); -// this.lblProxyPass.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, -// false, false, 1, 1)); -// this.lblProxyPass.setBounds(0, 0, 57, 15); -// -// FontData[] fD_lblProxyPass = this.lblProxyPass.getFont().getFontData(); -// fD_lblProxyPass[0].setHeight(Constants.TEXT_SIZE_NORMAL); -// this.lblProxyPass.setFont(new Font(Display.getCurrent(), -// fD_lblProxyPass[0])); -// -// Composite compProxyPassContainer = new Composite(this.grpProxy, SWT.NONE); -// compProxyPassContainer.setLayout(new FormLayout()); -// compProxyPassContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, -// 1, 1)); -// this.txtProxyPass = new Text(compProxyPassContainer, SWT.PASSWORD | SWT.BORDER); -// FormData fd_txtProxyPass = new FormData(); -// fd_txtProxyPass.right = new FormAttachment(100, -42); -// fd_txtProxyPass.top = new FormAttachment(0); -// fd_txtProxyPass.left = new FormAttachment(0, 5); -// -// FontData[] fD_txtProxyPass = this.txtProxyPass.getFont().getFontData(); -// fD_txtProxyPass[0].setHeight(Constants.TEXT_SIZE_NORMAL); -// this.txtProxyPass.setFont(new Font(Display.getCurrent(), -// fD_txtProxyPass[0])); -// -// this.proxyPassErrorMarker = new ErrorMarker(compProxyPassContainer, SWT.NONE, ""); //$NON-NLS-1$ -// -// FormData fd_proxyPassErrorMarker = new FormData(); -// fd_proxyPassErrorMarker.left = new FormAttachment(100, -32); -// fd_proxyPassErrorMarker.right = new FormAttachment(100); -// fd_proxyPassErrorMarker.top = new FormAttachment(0); -// fd_proxyPassErrorMarker.bottom = new FormAttachment(0, 32); -// -// this.proxyPassErrorMarker.setLayoutData(fd_proxyPassErrorMarker); -// this.proxyPassErrorMarker.setVisible(false); -// this.txtProxyPass.setLayoutData(fd_txtProxyPass); -// -// this.txtProxyPass.addFocusListener(new FocusAdapter() { -// -// @Override -// public void focusLost(FocusEvent e) { -// processProxyPassChanged(); -// } -// }); -// -// this.txtProxyPass.addTraverseListener(new TraverseListener() { -// -// @Override -// public void keyTraversed(TraverseEvent e) { -// if (e.detail == SWT.TRAVERSE_RETURN) { -// processProxyPassChanged(); -// } -// } -// }); - reloadResources(); } @@ -990,44 +872,6 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.configurationContainer.setProxyHost(host); } -// void processProxyUserChanged() { -// try { -// this.proxyUserErrorMarker.setVisible(false); -// plainProxyUserSetter(); -// } catch (Exception ex) { -// this.proxyUserErrorMarker.setVisible(true); -// this.proxyUserErrorMarker.setToolTipText(ex.getMessage()); -// log.error("processProxyUser: ", ex); //$NON-NLS-1$ -// } -// } -// -// /** -// * -// */ -// private void plainProxyUserSetter() { -// String user = this.txtProxyUser.getText(); -// this.configurationContainer.setProxyUser(user); -// } -// -// void processProxyPassChanged() { -// try { -// this.proxyPassErrorMarker.setVisible(false); -// plainProxyPassSetter(); -// } catch (Exception ex) { -// this.proxyPassErrorMarker.setVisible(true); -// this.proxyPassErrorMarker.setToolTipText(ex.getMessage()); -// log.error("processProxyPass: ", ex); //$NON-NLS-1$ -// } -// } -// -// /** -// * -// */ -// private void plainProxyPassSetter() { -// String pass = this.txtProxyPass.getText(); -// this.configurationContainer.setProxyPass(pass); -// } - void processProxyPortChanged() { try { this.txtProxyPortErrorMarker.setVisible(false); @@ -1109,6 +953,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { provider.getProxyUserPersistent()); this.configurationContainer.setProxyPass( provider.getProxyPassPersistent()); + this.configurationContainer.setSignatureProfile(PROFILE.getProfile(provider.getSignatureProfile())); } /* @@ -1136,6 +981,8 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { performPdfACompatSelection(this.configurationContainer.getSignaturePdfACompat()); performKeystoreEnabledSelection(this.configurationContainer.getKeyStoreEnabled()); performUpdateCheckSelection(this.configurationContainer.getUpdateCheck()); + performSetSignatureProfile(this.configurationContainer.getSignatureProfile()); + int port = this.configurationContainer.getProxyPort(); if (port > 0) { @@ -1146,19 +993,18 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { if (host != null) { this.txtProxyHost.setText(host); } - - /*String user = this.configurationContainer.getProxyUser(); - if (user != null) { - this.txtProxyUser.setText(user); - } - - String pass = this.configurationContainer.getProxyPass(); - if (pass != null) { - this.txtProxyPass.setText(pass); - }*/ + } + /** + * @param profile + * + */ + public void performSetSignatureProfile(PROFILE profile) { + this.configurationContainer.setSignatureProfile(profile); + } + /* (non-Javadoc) * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#storeConfiguration(at.asit.pdfover.gui.workflow.config.ConfigManipulator, at.asit.pdfover.gui.workflow.config.PersistentConfigProvider) */ -- cgit v1.2.3 From d658f95290ea03bd0ecdc01110b48244b28e6f19 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Fri, 13 Nov 2020 13:49:59 +0100 Subject: refactored Profile --- .../asit/pdfover/gui/composites/AdvancedConfigurationComposite.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 e9ed5316..f4b3ae0b 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 @@ -48,7 +48,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.Constants; -import at.asit.pdfover.gui.Constants.PROFILE; +import at.asit.pdfover.commons.Profile; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.controls.ErrorMarker; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; @@ -953,7 +953,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { provider.getProxyUserPersistent()); this.configurationContainer.setProxyPass( provider.getProxyPassPersistent()); - this.configurationContainer.setSignatureProfile(PROFILE.getProfile(provider.getSignatureProfile())); + this.configurationContainer.setSignatureProfile(Profile.getProfile(provider.getSignatureProfile())); } /* @@ -1001,7 +1001,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { * @param profile * */ - public void performSetSignatureProfile(PROFILE profile) { + public void performSetSignatureProfile(Profile profile) { this.configurationContainer.setSignatureProfile(profile); } -- cgit v1.2.3 From df362d82d20d0301099ff3b43517034b4880bd9c Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 09:24:38 +0100 Subject: Fixed smaller bugs and typos --- .../gui/composites/AdvancedConfigurationComposite.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 f4b3ae0b..27b0f135 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 @@ -1002,7 +1002,17 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { * */ public void performSetSignatureProfile(Profile profile) { - this.configurationContainer.setSignatureProfile(profile); + switch (profile){ + case INVISIBLE: + case AMTSSIGNATURBLOCK: + this.performPositionSelection(true); + this.btnAutomatischePositionierung.setEnabled(false); + this.grpPlaceholder.setEnabled(false); + break; + default: + this.btnAutomatischePositionierung.setEnabled(true); + this.grpPlaceholder.setEnabled(true); + } } /* (non-Javadoc) -- cgit v1.2.3 From 5ceb3061ada685cd02ae3f1236da108c88c953d2 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 09:53:08 +0100 Subject: Changed the GUI behaviour when selecting different profiles accordingly --- .../asit/pdfover/gui/composites/AdvancedConfigurationComposite.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 27b0f135..b03451b5 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 @@ -1007,11 +1007,12 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { case AMTSSIGNATURBLOCK: this.performPositionSelection(true); this.btnAutomatischePositionierung.setEnabled(false); - this.grpPlaceholder.setEnabled(false); + this.btnEnablePlaceholderUsage.setEnabled(true); + this.performEnableUsePlaceholder(false); break; default: this.btnAutomatischePositionierung.setEnabled(true); - this.grpPlaceholder.setEnabled(true); + this.btnEnablePlaceholderUsage.setEnabled(true); } } -- cgit v1.2.3 From 1feb15655af5bdd685afa814832aaf5d3e522409 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 09:58:37 +0100 Subject: Improved code quality according to SonarLint --- .../composites/AdvancedConfigurationComposite.java | 42 ++++++++-------------- 1 file changed, 15 insertions(+), 27 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 b03451b5..3d8d7726 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 @@ -26,8 +26,6 @@ import org.eclipse.swt.events.FocusAdapter; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.TraverseEvent; -import org.eclipse.swt.events.TraverseListener; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.layout.FormAttachment; @@ -363,7 +361,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { fD_cmbBKUAuswahl[0])); int blen = BKUs.values().length; - this.bkuStrings = new ArrayList(blen); + this.bkuStrings = new ArrayList<>(blen); for (int i = 0; i < blen; i++) { String lookup = "BKU." + BKUs.values()[i].toString(); //$NON-NLS-1$ String text = Messages.getString(lookup); @@ -651,13 +649,9 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { } }); - this.txtProxyHost.addTraverseListener(new TraverseListener() { - - @Override - public void keyTraversed(TraverseEvent e) { - if (e.detail == SWT.TRAVERSE_RETURN) { - processProxyHostChanged(); - } + this.txtProxyHost.addTraverseListener(e -> { + if (e.detail == SWT.TRAVERSE_RETURN) { + processProxyHostChanged(); } }); @@ -687,13 +681,9 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.txtProxyPort.setFont(new Font(Display.getCurrent(), fD_txtProxyPort[0])); - this.txtProxyPort.addTraverseListener(new TraverseListener() { - - @Override - public void keyTraversed(TraverseEvent e) { - if (e.detail == SWT.TRAVERSE_RETURN) { - processProxyPortChanged(); - } + this.txtProxyPort.addTraverseListener(e -> { + if (e.detail == SWT.TRAVERSE_RETURN) { + processProxyPortChanged(); } }); @@ -729,7 +719,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { } void performOutputFolderChanged(String foldername) { - log.debug("Selected Output folder: " + foldername); //$NON-NLS-1$ + log.debug("Selected Output folder: {}", foldername); //$NON-NLS-1$ this.configurationContainer.setOutputFolder(foldername); AdvancedConfigurationComposite.this.txtOutputFolder.setText(foldername); } @@ -740,14 +730,14 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { 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); //$NON-NLS-1$ return 0; } return i; } void performBKUSelectionChanged(BKUs selected) { - log.debug("Selected BKU: " + selected.toString()); //$NON-NLS-1$ + log.debug("Selected BKU: {}", selected); //$NON-NLS-1$ this.configurationContainer.setDefaultBKU(selected); this.cmbBKUAuswahl.select(this.getBKUElementIndex(selected)); } @@ -757,7 +747,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { BKUs bkuvalue = resolveBKU(selected); this.performBKUSelectionChanged(bkuvalue); } catch (Exception ex) { - log.error("Failed to parse BKU value: " + selected, ex); //$NON-NLS-1$ + 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$ dialog.open(); @@ -780,23 +770,23 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { int getLocaleElementIndex(Locale locale) { for (int i = 0; i < Constants.SUPPORTED_LOCALES.length; i++) { if (Constants.SUPPORTED_LOCALES[i].equals(locale)) { - log.debug("Locale: " + locale + " IDX: " + i); //$NON-NLS-1$ //$NON-NLS-2$ + log.debug("Locale: {} IDX: {}", locale, i); //$NON-NLS-1$ //$NON-NLS-2$ return i; } } - log.warn("NO Locale match for " + locale); //$NON-NLS-1$ + log.warn("NO Locale match for {}", locale); //$NON-NLS-1$ return 0; } void performLocaleSelectionChanged(Locale selected) { - log.debug("Selected Locale: " + selected); //$NON-NLS-1$ + log.debug("Selected Locale: {}", selected); //$NON-NLS-1$ 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); //$NON-NLS-1$ SignaturePosition pos = automatic ? new SignaturePosition() : null; this.configurationContainer.setDefaultSignaturePosition(pos); this.btnAutomatischePositionierung.setSelection(automatic); @@ -921,8 +911,6 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.configurationContainer.setUseMarker(provider.getUseMarker()); this.configurationContainer.setUseSignatureFields(provider.getUseSignatureFields()); this.configurationContainer.setEnablePlaceholderUsage(provider.getEnablePlaceholderUsage()); - /*this.configurationContainer.setDownloadURL( - provider.getDownloadURL());*/ this.configurationContainer.setSignaturePdfACompat( provider.getSignaturePdfACompat()); this.configurationContainer.setPlaceholderTransparency( -- cgit v1.2.3 From 21540b68c6e2088435bd1aa643d1ae543c5e5337 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 11:30:08 +0100 Subject: AdvancedConfig extended --- .../composites/AdvancedConfigurationComposite.java | 45 ++++++++++++++++++++-- 1 file changed, 41 insertions(+), 4 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 3d8d7726..c29abb33 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 @@ -94,12 +94,14 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { List bkuStrings; Button btnKeystoreEnabled; - private Group grpSpeicherort; - private Label lblDefaultOutputFolder; + private final Group grpSpeicherort; + private final Label lblDefaultOutputFolder; Text txtOutputFolder; - private Button btnBrowse; + private final Button btnBrowse; + private final Label lblSaveFilePostFix; + private final Text txtSaveFilePostFix; - private Group grpLocaleAuswahl; + private final Group grpLocaleAuswahl; Combo cmbLocaleAuswahl; private Group grpUpdateCheck; @@ -500,6 +502,41 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { } } }); + + + this.lblSaveFilePostFix = new Label(this.grpSpeicherort, SWT.NONE); + FormData fd_lblSaveFilePostFix = new FormData(); + fd_lblSaveFilePostFix.top = new FormAttachment(this.lblDefaultOutputFolder); + fd_lblSaveFilePostFix.left = new FormAttachment(0, 5); + this.lblSaveFilePostFix.setLayoutData(fd_lblSaveFilePostFix); + + FontData[] fD_lblSaveFilePostFix = this.lblSaveFilePostFix.getFont() + .getFontData(); + fD_lblSaveFilePostFix[0].setHeight(Constants.TEXT_SIZE_NORMAL); + this.lblSaveFilePostFix.setFont(new Font(Display.getCurrent(), + fD_lblSaveFilePostFix[0])); + + this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.NONE); + FormData fd_PostFix = new FormData(); + fd_PostFix.top = new FormAttachment(this.lblSaveFilePostFix, 5); + fd_PostFix.left = new FormAttachment(0, 15); + this.txtSaveFilePostFix.setLayoutData(fd_text); + + FontData[] fD_txtPostFix = this.txtSaveFilePostFix.getFont() + .getFontData(); + fD_txtOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); + this.txtSaveFilePostFix.setFont(new Font(Display.getCurrent(), + fD_txtOutputFolder[0])); + + this.txtSaveFilePostFix.addFocusListener(new FocusAdapter() { + + @Override + public void focusLost(FocusEvent e) { + //performOutputFolderChanged(AdvancedConfigurationComposite.this.txtSaveFilePostFix + //.getText()); + } + }); + this.grpLocaleAuswahl = new Group(this, SWT.NONE); FormLayout layout_grpLocaleAuswahl = new FormLayout(); -- cgit v1.2.3 From ba13450bf503469436b63789553163746bab7e43 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 13:53:31 +0100 Subject: New grid layout implemented to support postfix file names --- .../composites/AdvancedConfigurationComposite.java | 197 ++++++++++----------- 1 file changed, 91 insertions(+), 106 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 c29abb33..34b6535a 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 @@ -412,13 +412,11 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { }); this.grpSpeicherort = new Group(this, SWT.NONE); - layout = new FormLayout(); - layout.marginHeight = 10; - layout.marginWidth = 5; - this.grpSpeicherort.setLayout(layout); + GridLayout gl_grpSpeicherort = new GridLayout(3, false); + grpSpeicherort.setLayout(gl_grpSpeicherort); FormData fd_grpSpeicherort = new FormData(); + fd_grpSpeicherort.left = new FormAttachment(100, -499); fd_grpSpeicherort.top = new FormAttachment(this.grpBkuAuswahl, 5); - fd_grpSpeicherort.left = new FormAttachment(0, 5); fd_grpSpeicherort.right = new FormAttachment(100, -5); this.grpSpeicherort.setLayoutData(fd_grpSpeicherort); @@ -428,114 +426,101 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { fD_grpSpeicherort[0])); this.lblDefaultOutputFolder = new Label(this.grpSpeicherort, SWT.NONE); - FormData fd_lblDefaultOutputFolder = new FormData(); - fd_lblDefaultOutputFolder.top = new FormAttachment(0); - fd_lblDefaultOutputFolder.left = new FormAttachment(0, 5); - this.lblDefaultOutputFolder.setLayoutData(fd_lblDefaultOutputFolder); FontData[] fD_lblDefaultOutputFolder = this.lblDefaultOutputFolder.getFont() .getFontData(); fD_lblDefaultOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); this.lblDefaultOutputFolder.setFont(new Font(Display.getCurrent(), fD_lblDefaultOutputFolder[0])); - - this.txtOutputFolder = new Text(this.grpSpeicherort, SWT.BORDER); - FormData fd_text = new FormData(); - fd_text.top = new FormAttachment(this.lblDefaultOutputFolder, 5); - fd_text.left = new FormAttachment(0, 15); - this.txtOutputFolder.setLayoutData(fd_text); - - FontData[] fD_txtOutputFolder = this.txtOutputFolder.getFont() - .getFontData(); + + this.txtOutputFolder = new Text(this.grpSpeicherort, SWT.BORDER); + GridData gd_txtOutputFolder = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); + gd_txtOutputFolder.widthHint = 291; + txtOutputFolder.setLayoutData(gd_txtOutputFolder); + + FontData[] fD_txtOutputFolder = this.txtOutputFolder.getFont() + .getFontData(); + this.txtOutputFolder.setFont(new Font(Display.getCurrent(), + fD_txtOutputFolder[0])); + + this.txtOutputFolder.addFocusListener(new FocusAdapter() { + + @Override + public void focusLost(FocusEvent e) { + performOutputFolderChanged(AdvancedConfigurationComposite.this.txtOutputFolder + .getText()); + } + }); fD_txtOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.txtOutputFolder.setFont(new Font(Display.getCurrent(), - fD_txtOutputFolder[0])); - - this.txtOutputFolder.addFocusListener(new FocusAdapter() { - - @Override - public void focusLost(FocusEvent e) { - performOutputFolderChanged(AdvancedConfigurationComposite.this.txtOutputFolder - .getText()); - } - }); - - this.btnBrowse = new Button(this.grpSpeicherort, SWT.NONE); - fd_text.right = new FormAttachment(this.btnBrowse, -5); - - FontData[] fD_btnBrowse = this.btnBrowse.getFont().getFontData(); - fD_btnBrowse[0].setHeight(Constants.TEXT_SIZE_BUTTON); - this.btnBrowse.setFont(new Font(Display.getCurrent(), fD_btnBrowse[0])); - - FormData fd_btnBrowse = new FormData(); - fd_btnBrowse.top = new FormAttachment(this.lblDefaultOutputFolder, 5); - fd_btnBrowse.right = new FormAttachment(100, -5); - this.btnBrowse.setLayoutData(fd_btnBrowse); - - this.btnBrowse.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - DirectoryDialog dlg = new DirectoryDialog( - AdvancedConfigurationComposite.this.getShell()); - - // 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")); //$NON-NLS-1$ - - // Customizable message displayed in the dialog - dlg.setMessage(Messages - .getString("advanced_config.OutputFolder.Dialog")); //$NON-NLS-1$ - - // Calling open() will open and run the dialog. - // It will return the selected directory, or - // null if user cancels - String dir = dlg.open(); - if (dir != null) { - // Set the text box to the new selection - performOutputFolderChanged(dir); - } - } - }); - - - this.lblSaveFilePostFix = new Label(this.grpSpeicherort, SWT.NONE); - FormData fd_lblSaveFilePostFix = new FormData(); - fd_lblSaveFilePostFix.top = new FormAttachment(this.lblDefaultOutputFolder); - fd_lblSaveFilePostFix.left = new FormAttachment(0, 5); - this.lblSaveFilePostFix.setLayoutData(fd_lblSaveFilePostFix); - - FontData[] fD_lblSaveFilePostFix = this.lblSaveFilePostFix.getFont() - .getFontData(); +// fD_btnBrowse[0].setHeight(Constants.TEXT_SIZE_BUTTON); + + this.btnBrowse = new Button(this.grpSpeicherort, SWT.NONE); + btnBrowse.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); + + FontData[] fD_btnBrowse = this.btnBrowse.getFont().getFontData(); + this.btnBrowse.setFont(new Font(Display.getCurrent(), fD_btnBrowse[0])); + + this.btnBrowse.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + DirectoryDialog dlg = new DirectoryDialog( + AdvancedConfigurationComposite.this.getShell()); + + // 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")); //$NON-NLS-1$ + + // Customizable message displayed in the dialog + dlg.setMessage(Messages + .getString("advanced_config.OutputFolder.Dialog")); //$NON-NLS-1$ + + // Calling open() will open and run the dialog. + // It will return the selected directory, or + // null if user cancels + String dir = dlg.open(); + if (dir != null) { + // Set the text box to the new selection + performOutputFolderChanged(dir); + } + } + }); + + + this.lblSaveFilePostFix = new Label(this.grpSpeicherort, SWT.NONE); + lblSaveFilePostFix.setText(Messages.getString("AdvancedConfigurationComposite.lblSaveFilePostFix.text")); + + FontData[] fD_lblSaveFilePostFix = this.lblSaveFilePostFix.getFont() + .getFontData(); + this.lblSaveFilePostFix.setFont(new Font(Display.getCurrent(), + fD_lblSaveFilePostFix[0])); + + this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.BORDER); + GridData gd_txtSaveFilePostFix = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); + gd_txtSaveFilePostFix.widthHint = 256; + txtSaveFilePostFix.setLayoutData(gd_txtSaveFilePostFix); + + FontData[] fD_txtPostFix = this.txtSaveFilePostFix.getFont() + .getFontData(); + this.txtSaveFilePostFix.setFont(new Font(Display.getCurrent(), + fD_txtPostFix[0])); + + this.txtSaveFilePostFix.addFocusListener(new FocusAdapter() { + + @Override + public void focusLost(FocusEvent e) { + //performOutputFolderChanged(AdvancedConfigurationComposite.this.txtSaveFilePostFix + //.getText()); + } + }); + new Label(grpSpeicherort, SWT.NONE); fD_lblSaveFilePostFix[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.lblSaveFilePostFix.setFont(new Font(Display.getCurrent(), - fD_lblSaveFilePostFix[0])); - - this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.NONE); - FormData fd_PostFix = new FormData(); - fd_PostFix.top = new FormAttachment(this.lblSaveFilePostFix, 5); - fd_PostFix.left = new FormAttachment(0, 15); - this.txtSaveFilePostFix.setLayoutData(fd_text); - - FontData[] fD_txtPostFix = this.txtSaveFilePostFix.getFont() - .getFontData(); - fD_txtOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.txtSaveFilePostFix.setFont(new Font(Display.getCurrent(), - fD_txtOutputFolder[0])); - - this.txtSaveFilePostFix.addFocusListener(new FocusAdapter() { - - @Override - public void focusLost(FocusEvent e) { - //performOutputFolderChanged(AdvancedConfigurationComposite.this.txtSaveFilePostFix - //.getText()); - } - }); + fD_txtPostFix[0].setHeight(Constants.TEXT_SIZE_NORMAL); this.grpLocaleAuswahl = new Group(this, SWT.NONE); @@ -544,7 +529,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { layout_grpLocaleAuswahl.marginWidth = 5; this.grpLocaleAuswahl.setLayout(layout_grpLocaleAuswahl); FormData fd_grpLocaleAuswahl = new FormData(); - fd_grpLocaleAuswahl.top = new FormAttachment(this.grpSpeicherort, 5); + fd_grpLocaleAuswahl.top = new FormAttachment(grpSpeicherort, 5); fd_grpLocaleAuswahl.left = new FormAttachment(0, 5); fd_grpLocaleAuswahl.right = new FormAttachment(100, -5); this.grpLocaleAuswahl.setLayoutData(fd_grpLocaleAuswahl); -- cgit v1.2.3 From 4a77926f1ccfe2aed8c04dc7eb6180511e9920a3 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 14:07:46 +0100 Subject: Small improvement in Advanced GUI --- .../composites/AdvancedConfigurationComposite.java | 693 +++++++++------------ 1 file changed, 291 insertions(+), 402 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 34b6535a..94474c66 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 @@ -71,19 +71,17 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { /** * SLF4J Logger instance **/ - private static final Logger log = LoggerFactory - .getLogger(AdvancedConfigurationComposite.class); - + private static final Logger log = LoggerFactory.getLogger(AdvancedConfigurationComposite.class); private ConfigurationComposite configurationComposite; private Group grpSignatur; - private Group grpPlaceholder; + private Group grpPlaceholder; Button btnAutomatischePositionierung; Button btnPdfACompat; Button btnPlatzhalterVerwenden; - Button btnSignatureFieldsUsage; - Button btnEnablePlaceholderUsage; + Button btnSignatureFieldsUsage; + Button btnEnablePlaceholderUsage; private Label lblTransparenz; private Label lblTransparenzLinks; private Label lblTransparenzRechts; @@ -117,7 +115,6 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { FormData fd_txtProxyPort; FormData fd_txtProxyPortErrorMarker; - /** * @param parent * @param style @@ -125,8 +122,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { * @param container * @param config */ - public AdvancedConfigurationComposite(Composite parent, int style, - State state, ConfigurationContainer container, + public AdvancedConfigurationComposite(Composite parent, int style, State state, ConfigurationContainer container, ConfigurationComposite config) { super(parent, style, state, container); this.configurationComposite = config; @@ -145,73 +141,55 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_grpSignaturPosition = this.grpSignatur.getFont().getFontData(); fD_grpSignaturPosition[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.grpSignatur.setFont(new Font(Display.getCurrent(), - fD_grpSignaturPosition[0])); + this.grpSignatur.setFont(new Font(Display.getCurrent(), fD_grpSignaturPosition[0])); this.btnAutomatischePositionierung = new Button(this.grpSignatur, SWT.CHECK); FormData fd_btnAutomatischePositionierung = new FormData(); fd_btnAutomatischePositionierung.right = new FormAttachment(100, -5); fd_btnAutomatischePositionierung.top = new FormAttachment(0); fd_btnAutomatischePositionierung.left = new FormAttachment(0, 5); - this.btnAutomatischePositionierung - .setLayoutData(fd_btnAutomatischePositionierung); - - FontData[] fD_btnAutomatischePositionierung = this.btnAutomatischePositionierung - .getFont().getFontData(); - fD_btnAutomatischePositionierung[0] - .setHeight(Constants.TEXT_SIZE_BUTTON); - this.btnAutomatischePositionierung.setFont(new Font(Display - .getCurrent(), fD_btnAutomatischePositionierung[0])); - - this.btnAutomatischePositionierung - .addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - AdvancedConfigurationComposite.this - .performPositionSelection(AdvancedConfigurationComposite.this.btnAutomatischePositionierung - .getSelection()); - } - }); - - + this.btnAutomatischePositionierung.setLayoutData(fd_btnAutomatischePositionierung); + + FontData[] fD_btnAutomatischePositionierung = this.btnAutomatischePositionierung.getFont().getFontData(); + fD_btnAutomatischePositionierung[0].setHeight(Constants.TEXT_SIZE_BUTTON); + this.btnAutomatischePositionierung.setFont(new Font(Display.getCurrent(), fD_btnAutomatischePositionierung[0])); + + this.btnAutomatischePositionierung.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AdvancedConfigurationComposite.this.performPositionSelection( + AdvancedConfigurationComposite.this.btnAutomatischePositionierung.getSelection()); + } + }); this.btnPdfACompat = new Button(this.grpSignatur, SWT.CHECK); FormData fd_btnPdfACompat = new FormData(); fd_btnPdfACompat.right = new FormAttachment(100, -5); - fd_btnPdfACompat.top = new FormAttachment( - this.btnAutomatischePositionierung, 5); + fd_btnPdfACompat.top = new FormAttachment(this.btnAutomatischePositionierung, 5); fd_btnPdfACompat.left = new FormAttachment(0, 5); - this.btnPdfACompat - .setLayoutData(fd_btnPdfACompat); - - FontData[] fD_btnPdfACompat = this.btnPdfACompat - .getFont().getFontData(); - fD_btnPdfACompat[0] - .setHeight(Constants.TEXT_SIZE_BUTTON); - this.btnPdfACompat.setFont(new Font(Display - .getCurrent(), fD_btnPdfACompat[0])); - - this.btnPdfACompat - .addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - AdvancedConfigurationComposite.this - .performPdfACompatSelection(AdvancedConfigurationComposite.this.btnPdfACompat - .getSelection()); - } - }); + this.btnPdfACompat.setLayoutData(fd_btnPdfACompat); + + FontData[] fD_btnPdfACompat = this.btnPdfACompat.getFont().getFontData(); + fD_btnPdfACompat[0].setHeight(Constants.TEXT_SIZE_BUTTON); + this.btnPdfACompat.setFont(new Font(Display.getCurrent(), fD_btnPdfACompat[0])); + + this.btnPdfACompat.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AdvancedConfigurationComposite.this + .performPdfACompatSelection(AdvancedConfigurationComposite.this.btnPdfACompat.getSelection()); + } + }); this.lblTransparenz = new Label(this.grpSignatur, SWT.HORIZONTAL); FormData fd_lblTransparenz = new FormData(); - fd_lblTransparenz.top = new FormAttachment( - this.btnPdfACompat, 5); + fd_lblTransparenz.top = new FormAttachment(this.btnPdfACompat, 5); fd_lblTransparenz.left = new FormAttachment(0, 5); this.lblTransparenz.setLayoutData(fd_lblTransparenz); FontData[] fD_lblTransparenz = this.lblTransparenz.getFont().getFontData(); fD_lblTransparenz[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.lblTransparenz.setFont(new Font(Display.getCurrent(), - fD_lblTransparenz[0])); + this.lblTransparenz.setFont(new Font(Display.getCurrent(), fD_lblTransparenz[0])); this.lblTransparenzLinks = new Label(this.grpSignatur, SWT.HORIZONTAL); FormData fd_lblTransparenzLinks = new FormData(); @@ -219,11 +197,9 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { fd_lblTransparenzLinks.left = new FormAttachment(0, 15); this.lblTransparenzLinks.setLayoutData(fd_lblTransparenzLinks); - FontData[] fD_lblTransparenzLinks = this.lblTransparenzLinks.getFont() - .getFontData(); + FontData[] fD_lblTransparenzLinks = this.lblTransparenzLinks.getFont().getFontData(); fD_lblTransparenzLinks[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.lblTransparenzLinks.setFont(new Font(Display.getCurrent(), - fD_lblTransparenzLinks[0])); + this.lblTransparenzLinks.setFont(new Font(Display.getCurrent(), fD_lblTransparenzLinks[0])); this.lblTransparenzRechts = new Label(this.grpSignatur, SWT.HORIZONTAL); FormData fd_lblTransparenzRechts = new FormData(); @@ -231,11 +207,9 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { fd_lblTransparenzRechts.right = new FormAttachment(100, -5); this.lblTransparenzRechts.setLayoutData(fd_lblTransparenzRechts); - FontData[] fD_lblTransparenzRechts = this.lblTransparenzRechts.getFont() - .getFontData(); + FontData[] fD_lblTransparenzRechts = this.lblTransparenzRechts.getFont().getFontData(); fD_lblTransparenzRechts[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.lblTransparenzRechts.setFont(new Font(Display.getCurrent(), - fD_lblTransparenzRechts[0])); + this.lblTransparenzRechts.setFont(new Font(Display.getCurrent(), fD_lblTransparenzRechts[0])); this.sclTransparenz = new Scale(this.grpSignatur, SWT.HORIZONTAL); FormData fd_sldTransparenz = new FormData(); @@ -250,30 +224,26 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.sclTransparenz.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - performPlaceholderTransparency(AdvancedConfigurationComposite.this.sclTransparenz - .getSelection()); + performPlaceholderTransparency(AdvancedConfigurationComposite.this.sclTransparenz.getSelection()); } }); - - + this.grpPlaceholder = new Group(this, SWT.NONE); FormLayout layout_grpPlaceholder = new FormLayout(); layout_grpPlaceholder.marginHeight = 10; layout_grpPlaceholder.marginWidth = 5; this.grpPlaceholder.setLayout(layout_grpPlaceholder); - + FormData fd_grpPlaceholder = new FormData(); fd_grpPlaceholder.top = new FormAttachment(this.grpSignatur, 5); fd_grpPlaceholder.right = new FormAttachment(100, -5); fd_grpPlaceholder.left = new FormAttachment(0, 5); this.grpPlaceholder.setLayoutData(fd_grpPlaceholder); - + FontData[] fD_grpPlaceholder = this.grpPlaceholder.getFont().getFontData(); fD_grpPlaceholder[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.grpPlaceholder.setFont(new Font(Display.getCurrent(), - fD_grpPlaceholder[0])); - - + this.grpPlaceholder.setFont(new Font(Display.getCurrent(), fD_grpPlaceholder[0])); + this.btnEnablePlaceholderUsage = new Button(this.grpPlaceholder, SWT.CHECK); FormData fd_btnEnablePlaceholderUsage = new FormData(); fd_btnEnablePlaceholderUsage.right = new FormAttachment(100, -5); @@ -311,19 +281,18 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { AdvancedConfigurationComposite.this.btnPlatzhalterVerwenden.getSelection()); } }); - + this.btnSignatureFieldsUsage = new Button(this.grpPlaceholder, SWT.RADIO); FormData fd_btnSignatureFieldsUsage = new FormData(); fd_btnSignatureFieldsUsage.right = new FormAttachment(100, -5); fd_btnSignatureFieldsUsage.top = new FormAttachment(this.btnPlatzhalterVerwenden, 5); fd_btnSignatureFieldsUsage.left = new FormAttachment(0, 5); this.btnSignatureFieldsUsage.setLayoutData(fd_btnSignatureFieldsUsage); - - + FontData[] fD_btnSignatureFieldsUsage = this.btnSignatureFieldsUsage.getFont().getFontData(); fD_btnSignatureFieldsUsage[0].setHeight(Constants.TEXT_SIZE_BUTTON); this.btnSignatureFieldsUsage.setFont(new Font(Display.getCurrent(), fD_btnSignatureFieldsUsage[0])); - + this.btnSignatureFieldsUsage.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -331,7 +300,6 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { AdvancedConfigurationComposite.this.btnSignatureFieldsUsage.getSelection()); } }); - this.grpBkuAuswahl = new Group(this, SWT.NONE); layout = new FormLayout(); @@ -346,8 +314,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_grpBkuAuswahl = this.grpBkuAuswahl.getFont().getFontData(); fD_grpBkuAuswahl[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.grpBkuAuswahl.setFont(new Font(Display.getCurrent(), - fD_grpBkuAuswahl[0])); + this.grpBkuAuswahl.setFont(new Font(Display.getCurrent(), fD_grpBkuAuswahl[0])); this.cmbBKUAuswahl = new Combo(this.grpBkuAuswahl, SWT.READ_ONLY); FormData fd_cmbBKUAuswahl = new FormData(); @@ -356,11 +323,9 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { fd_cmbBKUAuswahl.left = new FormAttachment(0, 5); this.cmbBKUAuswahl.setLayoutData(fd_cmbBKUAuswahl); - FontData[] fD_cmbBKUAuswahl = this.cmbBKUAuswahl.getFont() - .getFontData(); + FontData[] fD_cmbBKUAuswahl = this.cmbBKUAuswahl.getFont().getFontData(); fD_cmbBKUAuswahl[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.cmbBKUAuswahl.setFont(new Font(Display.getCurrent(), - fD_cmbBKUAuswahl[0])); + this.cmbBKUAuswahl.setFont(new Font(Display.getCurrent(), fD_cmbBKUAuswahl[0])); int blen = BKUs.values().length; this.bkuStrings = new ArrayList<>(blen); @@ -374,15 +339,11 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { @Override public void widgetSelected(SelectionEvent e) { int selectionIndex = getBKUElementIndex( - AdvancedConfigurationComposite.this.configurationContainer - .getDefaultBKU()); - if (AdvancedConfigurationComposite.this.cmbBKUAuswahl - .getSelectionIndex() != selectionIndex) { - selectionIndex = AdvancedConfigurationComposite.this.cmbBKUAuswahl - .getSelectionIndex(); + AdvancedConfigurationComposite.this.configurationContainer.getDefaultBKU()); + if (AdvancedConfigurationComposite.this.cmbBKUAuswahl.getSelectionIndex() != selectionIndex) { + selectionIndex = AdvancedConfigurationComposite.this.cmbBKUAuswahl.getSelectionIndex(); performBKUSelectionChanged( - AdvancedConfigurationComposite.this.cmbBKUAuswahl - .getItem(selectionIndex)); + AdvancedConfigurationComposite.this.cmbBKUAuswahl.getItem(selectionIndex)); } } }); @@ -390,18 +351,13 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.btnKeystoreEnabled = new Button(this.grpBkuAuswahl, SWT.CHECK); FormData fd_btnKeystoreEnabled = new FormData(); fd_btnKeystoreEnabled.right = new FormAttachment(100, -5); - fd_btnKeystoreEnabled.top = new FormAttachment( - this.cmbBKUAuswahl, 5); + fd_btnKeystoreEnabled.top = new FormAttachment(this.cmbBKUAuswahl, 5); fd_btnKeystoreEnabled.left = new FormAttachment(0, 5); - this.btnKeystoreEnabled - .setLayoutData(fd_btnKeystoreEnabled); + this.btnKeystoreEnabled.setLayoutData(fd_btnKeystoreEnabled); - FontData[] fD_btnKeystoreEnabled = this.btnKeystoreEnabled - .getFont().getFontData(); - fD_btnKeystoreEnabled[0] - .setHeight(Constants.TEXT_SIZE_BUTTON); - this.btnKeystoreEnabled.setFont(new Font(Display - .getCurrent(), fD_btnKeystoreEnabled[0])); + FontData[] fD_btnKeystoreEnabled = this.btnKeystoreEnabled.getFont().getFontData(); + fD_btnKeystoreEnabled[0].setHeight(Constants.TEXT_SIZE_BUTTON); + this.btnKeystoreEnabled.setFont(new Font(Display.getCurrent(), fD_btnKeystoreEnabled[0])); this.btnKeystoreEnabled.addSelectionListener(new SelectionAdapter() { @Override @@ -422,107 +378,92 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_grpSpeicherort = this.grpSpeicherort.getFont().getFontData(); fD_grpSpeicherort[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.grpSpeicherort.setFont(new Font(Display.getCurrent(), - fD_grpSpeicherort[0])); + this.grpSpeicherort.setFont(new Font(Display.getCurrent(), fD_grpSpeicherort[0])); this.lblDefaultOutputFolder = new Label(this.grpSpeicherort, SWT.NONE); - FontData[] fD_lblDefaultOutputFolder = this.lblDefaultOutputFolder.getFont() - .getFontData(); + FontData[] fD_lblDefaultOutputFolder = this.lblDefaultOutputFolder.getFont().getFontData(); fD_lblDefaultOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.lblDefaultOutputFolder.setFont(new Font(Display.getCurrent(), - fD_lblDefaultOutputFolder[0])); - - this.txtOutputFolder = new Text(this.grpSpeicherort, SWT.BORDER); - GridData gd_txtOutputFolder = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); - gd_txtOutputFolder.widthHint = 291; - txtOutputFolder.setLayoutData(gd_txtOutputFolder); - - FontData[] fD_txtOutputFolder = this.txtOutputFolder.getFont() - .getFontData(); - this.txtOutputFolder.setFont(new Font(Display.getCurrent(), - fD_txtOutputFolder[0])); - - this.txtOutputFolder.addFocusListener(new FocusAdapter() { - - @Override - public void focusLost(FocusEvent e) { - performOutputFolderChanged(AdvancedConfigurationComposite.this.txtOutputFolder - .getText()); - } - }); + this.lblDefaultOutputFolder.setFont(new Font(Display.getCurrent(), fD_lblDefaultOutputFolder[0])); + + this.txtOutputFolder = new Text(this.grpSpeicherort, SWT.BORDER); + GridData gd_txtOutputFolder = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); + gd_txtOutputFolder.widthHint = 291; + txtOutputFolder.setLayoutData(gd_txtOutputFolder); + + FontData[] fD_txtOutputFolder = this.txtOutputFolder.getFont().getFontData(); + this.txtOutputFolder.setFont(new Font(Display.getCurrent(), fD_txtOutputFolder[0])); + + this.txtOutputFolder.addFocusListener(new FocusAdapter() { + + @Override + public void focusLost(FocusEvent e) { + performOutputFolderChanged(AdvancedConfigurationComposite.this.txtOutputFolder.getText()); + } + }); fD_txtOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); -// fD_btnBrowse[0].setHeight(Constants.TEXT_SIZE_BUTTON); - - this.btnBrowse = new Button(this.grpSpeicherort, SWT.NONE); - btnBrowse.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); - - FontData[] fD_btnBrowse = this.btnBrowse.getFont().getFontData(); - this.btnBrowse.setFont(new Font(Display.getCurrent(), fD_btnBrowse[0])); - - this.btnBrowse.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - DirectoryDialog dlg = new DirectoryDialog( - AdvancedConfigurationComposite.this.getShell()); - - // 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")); //$NON-NLS-1$ - - // Customizable message displayed in the dialog - dlg.setMessage(Messages - .getString("advanced_config.OutputFolder.Dialog")); //$NON-NLS-1$ - - // Calling open() will open and run the dialog. - // It will return the selected directory, or - // null if user cancels - String dir = dlg.open(); - if (dir != null) { - // Set the text box to the new selection - performOutputFolderChanged(dir); - } - } - }); - - - this.lblSaveFilePostFix = new Label(this.grpSpeicherort, SWT.NONE); - lblSaveFilePostFix.setText(Messages.getString("AdvancedConfigurationComposite.lblSaveFilePostFix.text")); - - FontData[] fD_lblSaveFilePostFix = this.lblSaveFilePostFix.getFont() - .getFontData(); - this.lblSaveFilePostFix.setFont(new Font(Display.getCurrent(), - fD_lblSaveFilePostFix[0])); - - this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.BORDER); - GridData gd_txtSaveFilePostFix = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); - gd_txtSaveFilePostFix.widthHint = 256; - txtSaveFilePostFix.setLayoutData(gd_txtSaveFilePostFix); - - FontData[] fD_txtPostFix = this.txtSaveFilePostFix.getFont() - .getFontData(); - this.txtSaveFilePostFix.setFont(new Font(Display.getCurrent(), - fD_txtPostFix[0])); - - this.txtSaveFilePostFix.addFocusListener(new FocusAdapter() { - - @Override - public void focusLost(FocusEvent e) { - //performOutputFolderChanged(AdvancedConfigurationComposite.this.txtSaveFilePostFix - //.getText()); - } - }); + // fD_btnBrowse[0].setHeight(Constants.TEXT_SIZE_BUTTON); + + this.btnBrowse = new Button(this.grpSpeicherort, SWT.NONE); + btnBrowse.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); + + FontData[] fD_btnBrowse = this.btnBrowse.getFont().getFontData(); + this.btnBrowse.setFont(new Font(Display.getCurrent(), fD_btnBrowse[0])); + + this.btnBrowse.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + DirectoryDialog dlg = new DirectoryDialog(AdvancedConfigurationComposite.this.getShell()); + + // 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")); //$NON-NLS-1$ + + // Customizable message displayed in the dialog + dlg.setMessage(Messages.getString("advanced_config.OutputFolder.Dialog")); //$NON-NLS-1$ + + // Calling open() will open and run the dialog. + // It will return the selected directory, or + // null if user cancels + String dir = dlg.open(); + if (dir != null) { + // Set the text box to the new selection + performOutputFolderChanged(dir); + } + } + }); + + this.lblSaveFilePostFix = new Label(this.grpSpeicherort, SWT.NONE); + lblSaveFilePostFix.setText(Messages.getString("AdvancedConfigurationComposite.lblSaveFilePostFix.text")); + + FontData[] fD_lblSaveFilePostFix = this.lblSaveFilePostFix.getFont().getFontData(); + fD_lblSaveFilePostFix[0].setHeight(Constants.TEXT_SIZE_NORMAL); + this.lblSaveFilePostFix.setFont(new Font(Display.getCurrent(), fD_lblSaveFilePostFix[0])); + + this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.BORDER); + GridData gd_txtSaveFilePostFix = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); +// gd_txtSaveFilePostFix.widthHint = 256; + txtSaveFilePostFix.setLayoutData(gd_txtSaveFilePostFix); + + FontData[] fD_txtPostFix = this.txtSaveFilePostFix.getFont().getFontData(); + this.txtSaveFilePostFix.setFont(new Font(Display.getCurrent(), fD_txtPostFix[0])); + + this.txtSaveFilePostFix.addFocusListener(new FocusAdapter() { + + @Override + public void focusLost(FocusEvent e) { + // performOutputFolderChanged(AdvancedConfigurationComposite.this.txtSaveFilePostFix + // .getText()); + } + }); new Label(grpSpeicherort, SWT.NONE); fD_lblSaveFilePostFix[0].setHeight(Constants.TEXT_SIZE_NORMAL); fD_txtPostFix[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.grpLocaleAuswahl = new Group(this, SWT.NONE); FormLayout layout_grpLocaleAuswahl = new FormLayout(); layout_grpLocaleAuswahl.marginHeight = 10; @@ -536,8 +477,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_grpLocaleAuswahl = this.grpLocaleAuswahl.getFont().getFontData(); fD_grpLocaleAuswahl[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.grpLocaleAuswahl.setFont(new Font(Display.getCurrent(), - fD_grpLocaleAuswahl[0])); + this.grpLocaleAuswahl.setFont(new Font(Display.getCurrent(), fD_grpLocaleAuswahl[0])); this.cmbLocaleAuswahl = new Combo(this.grpLocaleAuswahl, SWT.READ_ONLY); FormData fd_cmbLocaleAuswahl = new FormData(); @@ -546,11 +486,9 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { fd_cmbLocaleAuswahl.left = new FormAttachment(0, 5); this.cmbLocaleAuswahl.setLayoutData(fd_cmbLocaleAuswahl); - FontData[] fD_cmbLocaleAuswahl = this.cmbLocaleAuswahl.getFont() - .getFontData(); + FontData[] fD_cmbLocaleAuswahl = this.cmbLocaleAuswahl.getFont().getFontData(); fD_cmbLocaleAuswahl[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.cmbLocaleAuswahl.setFont(new Font(Display.getCurrent(), - fD_cmbLocaleAuswahl[0])); + this.cmbLocaleAuswahl.setFont(new Font(Display.getCurrent(), fD_cmbLocaleAuswahl[0])); String[] localeStrings = new String[Constants.SUPPORTED_LOCALES.length]; for (int i = 0; i < Constants.SUPPORTED_LOCALES.length; ++i) { @@ -560,11 +498,9 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.cmbLocaleAuswahl.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - Locale currentLocale = AdvancedConfigurationComposite.this.configurationContainer - .getLocale(); - Locale selectedLocale = Constants. - SUPPORTED_LOCALES[AdvancedConfigurationComposite.this.cmbLocaleAuswahl - .getSelectionIndex()]; + Locale currentLocale = AdvancedConfigurationComposite.this.configurationContainer.getLocale(); + Locale selectedLocale = Constants.SUPPORTED_LOCALES[AdvancedConfigurationComposite.this.cmbLocaleAuswahl + .getSelectionIndex()]; if (!currentLocale.equals(selectedLocale)) { performLocaleSelectionChanged(selectedLocale); } @@ -584,33 +520,26 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_grpUpdateCheck = this.grpUpdateCheck.getFont().getFontData(); fD_grpUpdateCheck[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.grpUpdateCheck.setFont(new Font(Display.getCurrent(), - fD_grpUpdateCheck[0])); + this.grpUpdateCheck.setFont(new Font(Display.getCurrent(), fD_grpUpdateCheck[0])); this.btnUpdateCheck = new Button(this.grpUpdateCheck, SWT.CHECK); FormData fd_btnUpdateCheck = new FormData(); fd_btnUpdateCheck.right = new FormAttachment(100, -5); fd_btnUpdateCheck.top = new FormAttachment(0); fd_btnUpdateCheck.left = new FormAttachment(0, 5); - this.btnUpdateCheck - .setLayoutData(fd_btnUpdateCheck); - - FontData[] fD_btnUpdateCheck = this.btnUpdateCheck - .getFont().getFontData(); - fD_btnUpdateCheck[0] - .setHeight(Constants.TEXT_SIZE_BUTTON); - this.btnUpdateCheck.setFont(new Font(Display - .getCurrent(), fD_btnUpdateCheck[0])); - - this.btnUpdateCheck - .addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - AdvancedConfigurationComposite.this - .performUpdateCheckSelection(AdvancedConfigurationComposite.this.btnUpdateCheck - .getSelection()); - } - }); + this.btnUpdateCheck.setLayoutData(fd_btnUpdateCheck); + + FontData[] fD_btnUpdateCheck = this.btnUpdateCheck.getFont().getFontData(); + fD_btnUpdateCheck[0].setHeight(Constants.TEXT_SIZE_BUTTON); + this.btnUpdateCheck.setFont(new Font(Display.getCurrent(), fD_btnUpdateCheck[0])); + + this.btnUpdateCheck.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AdvancedConfigurationComposite.this + .performUpdateCheckSelection(AdvancedConfigurationComposite.this.btnUpdateCheck.getSelection()); + } + }); this.grpProxy = new Group(this, SWT.NONE); FormData fd_grpProxy = new FormData(); @@ -625,21 +554,18 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.grpProxy.setFont(new Font(Display.getCurrent(), fD_grpProxy[0])); this.lblProxyHost = new Label(this.grpProxy, SWT.NONE); - GridData gd_lblProxyHost = new GridData(SWT.LEFT, SWT.CENTER, false, - false, 1, 1); + GridData gd_lblProxyHost = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_lblProxyHost.widthHint = 66; this.lblProxyHost.setLayoutData(gd_lblProxyHost); this.lblProxyHost.setBounds(0, 0, 57, 15); FontData[] fD_lblProxyHost = this.lblProxyHost.getFont().getFontData(); fD_lblProxyHost[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.lblProxyHost.setFont(new Font(Display.getCurrent(), - fD_lblProxyHost[0])); + this.lblProxyHost.setFont(new Font(Display.getCurrent(), fD_lblProxyHost[0])); Composite compProxyHostContainer = new Composite(this.grpProxy, SWT.NONE); compProxyHostContainer.setLayout(new FormLayout()); - compProxyHostContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, - 1, 1)); + compProxyHostContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1)); this.txtProxyHost = new Text(compProxyHostContainer, SWT.BORDER); FormData fd_txtProxyHost = new FormData(); fd_txtProxyHost.right = new FormAttachment(100, -42); @@ -648,8 +574,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_txtProxyHost = this.txtProxyHost.getFont().getFontData(); fD_txtProxyHost[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.txtProxyHost.setFont(new Font(Display.getCurrent(), - fD_txtProxyHost[0])); + this.txtProxyHost.setFont(new Font(Display.getCurrent(), fD_txtProxyHost[0])); this.proxyHostErrorMarker = new ErrorMarker(compProxyHostContainer, SWT.NONE, ""); //$NON-NLS-1$ @@ -680,16 +605,13 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.lblProxyPort = new Label(this.grpProxy, SWT.NONE); this.lblProxyPort.setBounds(0, 0, 57, 15); - FontData[] fD_lblProxyPort = this.lblProxyPort.getFont() - .getFontData(); + FontData[] fD_lblProxyPort = this.lblProxyPort.getFont().getFontData(); fD_lblProxyPort[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.lblProxyPort.setFont(new Font(Display.getCurrent(), - fD_lblProxyPort[0])); + this.lblProxyPort.setFont(new Font(Display.getCurrent(), fD_lblProxyPort[0])); Composite compProxyPortContainer = new Composite(this.grpProxy, SWT.NONE); compProxyPortContainer.setLayout(new FormLayout()); - compProxyPortContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, - 1, 1)); + compProxyPortContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1)); this.txtProxyPort = new Text(compProxyPortContainer, SWT.BORDER); this.fd_txtProxyPort = new FormData(); @@ -700,8 +622,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { FontData[] fD_txtProxyPort = this.txtProxyPort.getFont().getFontData(); fD_txtProxyPort[0].setHeight(Constants.TEXT_SIZE_NORMAL); - this.txtProxyPort.setFont(new Font(Display.getCurrent(), - fD_txtProxyPort[0])); + this.txtProxyPort.setFont(new Font(Display.getCurrent(), fD_txtProxyPort[0])); this.txtProxyPort.addTraverseListener(e -> { if (e.detail == SWT.TRAVERSE_RETURN) { @@ -715,8 +636,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.fd_txtProxyPortErrorMarker.right = new FormAttachment(100); this.fd_txtProxyPortErrorMarker.top = new FormAttachment(0); this.fd_txtProxyPortErrorMarker.bottom = new FormAttachment(0, 32); - this.txtProxyPortErrorMarker - .setLayoutData(this.fd_txtProxyPortErrorMarker); + this.txtProxyPortErrorMarker.setLayoutData(this.fd_txtProxyPortErrorMarker); this.txtProxyPortErrorMarker.setVisible(false); this.txtProxyPort.addFocusListener(new FocusAdapter() { @@ -770,8 +690,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { 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$ + ErrorDialog dialog = new ErrorDialog(getShell(), Messages.getString("error.InvalidBKU"), BUTTONS.OK); //$NON-NLS-1$ dialog.open(); } } @@ -800,7 +719,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { log.warn("NO Locale match for {}", locale); //$NON-NLS-1$ return 0; } - + void performLocaleSelectionChanged(Locale selected) { log.debug("Selected Locale: {}", selected); //$NON-NLS-1$ this.configurationContainer.setLocale(selected); @@ -823,14 +742,14 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.configurationContainer.setUseSignatureFields(useFields); this.btnSignatureFieldsUsage.setSelection(useFields); } - + void performEnableUsePlaceholder(boolean enable) { this.btnPlatzhalterVerwenden.setEnabled(enable); this.btnSignatureFieldsUsage.setEnabled(enable); this.configurationContainer.setEnablePlaceholderUsage(enable); this.btnEnablePlaceholderUsage.setSelection(enable); } - + void performPdfACompatSelection(boolean compat) { this.configurationContainer.setSignaturePdfACompat(compat); this.btnPdfACompat.setSelection(compat); @@ -915,6 +834,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { /* * (non-Javadoc) + * * @see at.asit.pdfover.gui.composites.StateComposite#doLayout() */ @Override @@ -922,78 +842,68 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { // Nothing to do here } - - /* (non-Javadoc) - * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#initConfiguration(at.asit.pdfover.gui.workflow.config.PersistentConfigProvider) + /* + * (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.setDefaultSignaturePosition( - provider.getDefaultSignaturePositionPersistent()); + this.configurationContainer.setDefaultSignaturePosition(provider.getDefaultSignaturePositionPersistent()); this.configurationContainer.setUseMarker(provider.getUseMarker()); this.configurationContainer.setUseSignatureFields(provider.getUseSignatureFields()); this.configurationContainer.setEnablePlaceholderUsage(provider.getEnablePlaceholderUsage()); - this.configurationContainer.setSignaturePdfACompat( - provider.getSignaturePdfACompat()); - this.configurationContainer.setPlaceholderTransparency( - provider.getPlaceholderTransparency()); + this.configurationContainer.setSignaturePdfACompat(provider.getSignaturePdfACompat()); + this.configurationContainer.setPlaceholderTransparency(provider.getPlaceholderTransparency()); - this.configurationContainer.setDefaultBKU( - provider.getDefaultBKUPersistent()); - this.configurationContainer.setKeyStoreEnabled( - provider.getKeyStoreEnabledPersistent()); + this.configurationContainer.setDefaultBKU(provider.getDefaultBKUPersistent()); + this.configurationContainer.setKeyStoreEnabled(provider.getKeyStoreEnabledPersistent()); - this.configurationContainer.setOutputFolder( - provider.getDefaultOutputFolderPersistent()); + this.configurationContainer.setOutputFolder(provider.getDefaultOutputFolderPersistent()); this.configurationContainer.setLocale(provider.getLocale()); - this.configurationContainer.setUpdateCheck( - provider.getUpdateCheck()); + this.configurationContainer.setUpdateCheck(provider.getUpdateCheck()); - this.configurationContainer.setProxyHost( - provider.getProxyHostPersistent()); + this.configurationContainer.setProxyHost(provider.getProxyHostPersistent()); try { - this.configurationContainer.setProxyPort( - provider.getProxyPortPersistent()); + this.configurationContainer.setProxyPort(provider.getProxyPortPersistent()); } catch (InvalidPortException e) { log.error("Failed to set proxy port!", e); //$NON-NLS-1$ } - this.configurationContainer.setProxyUser( - provider.getProxyUserPersistent()); - this.configurationContainer.setProxyPass( - provider.getProxyPassPersistent()); + this.configurationContainer.setProxyUser(provider.getProxyUserPersistent()); + this.configurationContainer.setProxyPass(provider.getProxyPassPersistent()); this.configurationContainer.setSignatureProfile(Profile.getProfile(provider.getSignatureProfile())); } /* * (non-Javadoc) - * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#loadConfiguration() + * + * @see + * at.asit.pdfover.gui.composites.BaseConfigurationComposite#loadConfiguration() */ @Override public void loadConfiguration() { // load advanced settings - performBKUSelectionChanged(this.configurationContainer - .getDefaultBKU()); + performBKUSelectionChanged(this.configurationContainer.getDefaultBKU()); String outputFolder = this.configurationContainer.getOutputFolder(); if (outputFolder != null) { performOutputFolderChanged(outputFolder); } - SignaturePosition pos = this.configurationContainer - .getDefaultSignaturePosition(); + SignaturePosition pos = this.configurationContainer.getDefaultSignaturePosition(); performPositionSelection(pos != null && pos.useAutoPositioning()); performUseMarkerSelection(this.configurationContainer.getUseMarker()); performUseSignatureFieldsSelection(this.configurationContainer.getUseSignatureFields()); performEnableUsePlaceholder(this.configurationContainer.getEnablePlaceholderUsage()); - this.sclTransparenz.setSelection(this.configurationContainer - .getPlaceholderTransparency()); + this.sclTransparenz.setSelection(this.configurationContainer.getPlaceholderTransparency()); performLocaleSelectionChanged(this.configurationContainer.getLocale()); performPdfACompatSelection(this.configurationContainer.getSignaturePdfACompat()); performKeystoreEnabledSelection(this.configurationContainer.getKeyStoreEnabled()); performUpdateCheckSelection(this.configurationContainer.getUpdateCheck()); performSetSignatureProfile(this.configurationContainer.getSignatureProfile()); - int port = this.configurationContainer.getProxyPort(); if (port > 0) { this.txtProxyPort.setText(Integer.toString(port)); @@ -1003,44 +913,44 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { if (host != null) { this.txtProxyHost.setText(host); } - -} + } /** - * @param profile + * @param profile * */ public void performSetSignatureProfile(Profile profile) { - switch (profile){ - case INVISIBLE: - case AMTSSIGNATURBLOCK: - this.performPositionSelection(true); - this.btnAutomatischePositionierung.setEnabled(false); - this.btnEnablePlaceholderUsage.setEnabled(true); - this.performEnableUsePlaceholder(false); - break; - default: - this.btnAutomatischePositionierung.setEnabled(true); - this.btnEnablePlaceholderUsage.setEnabled(true); + switch (profile) { + case INVISIBLE: + case AMTSSIGNATURBLOCK: + this.performPositionSelection(true); + this.btnAutomatischePositionierung.setEnabled(false); + this.btnEnablePlaceholderUsage.setEnabled(true); + this.performEnableUsePlaceholder(false); + break; + default: + this.btnAutomatischePositionierung.setEnabled(true); + this.btnEnablePlaceholderUsage.setEnabled(true); } } - /* (non-Javadoc) - * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#storeConfiguration(at.asit.pdfover.gui.workflow.config.ConfigManipulator, at.asit.pdfover.gui.workflow.config.PersistentConfigProvider) + /* + * (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(ConfigManipulator store, - PersistentConfigProvider provider) { - store.setDefaultSignaturePosition( - this.configurationContainer.getDefaultSignaturePosition()); + public void storeConfiguration(ConfigManipulator store, PersistentConfigProvider provider) { + store.setDefaultSignaturePosition(this.configurationContainer.getDefaultSignaturePosition()); store.setUseMarker(this.configurationContainer.getUseMarker()); store.setUseSignatureFields(this.configurationContainer.getUseSignatureFields()); store.setEnablePlaceholderUsage(this.configurationContainer.getEnablePlaceholderUsage()); - store.setSignaturePdfACompat( - this.configurationContainer.getSignaturePdfACompat()); - store.setPlaceholderTransparency( - this.configurationContainer.getPlaceholderTransparency()); + store.setSignaturePdfACompat(this.configurationContainer.getSignaturePdfACompat()); + store.setPlaceholderTransparency(this.configurationContainer.getPlaceholderTransparency()); store.setDefaultBKU(this.configurationContainer.getDefaultBKU()); store.setKeyStoreEnabled(this.configurationContainer.getKeyStoreEnabled()); @@ -1050,13 +960,12 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { store.setLocale(this.configurationContainer.getLocale()); store.setUpdateCheck(this.configurationContainer.getUpdateCheck()); - + store.setSignatureProfile(this.configurationContainer.getSignatureProfile().getName()); String hostOld = provider.getProxyHostPersistent(); String hostNew = this.configurationContainer.getProxyHost(); - if (hostOld != null && !hostOld.isEmpty() && - (hostNew == null || hostNew.isEmpty())) { + 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$ @@ -1075,8 +984,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { String userOld = provider.getProxyUserPersistent(); String userNew = this.configurationContainer.getProxyUser(); - if (userOld != null && !userOld.isEmpty() && - (userNew == null || userNew.isEmpty())) { + 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$ @@ -1092,121 +1000,102 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { } store.setProxyPass(passNew); } + /* * (non-Javadoc) - * @see at.asit.pdfover.gui.composites.BaseConfigurationComposite#validateSettings() + * + * @see + * at.asit.pdfover.gui.composites.BaseConfigurationComposite#validateSettings() */ @Override public void validateSettings(int resumeIndex) throws Exception { - + String foldername = this.configurationContainer.getOutputFolder(); - + switch (resumeIndex) { - case 0: - if (foldername != null && !foldername.isEmpty()) { - File outputFolder = new File(foldername); - if (!outputFolder.exists()) { - throw new OutputfolderDoesntExistException(outputFolder, 1); - } - if (!outputFolder.isDirectory()) { - throw new OutputfolderNotADirectoryException(outputFolder); - } + case 0: + if (foldername != null && !foldername.isEmpty()) { + File outputFolder = new File(foldername); + if (!outputFolder.exists()) { + throw new OutputfolderDoesntExistException(outputFolder, 1); } - // Fall through - case 1: - this.plainProxyHostSetter(); - // Fall through - case 2: - this.plainProxyPortSetter(); - // Fall through -// case 3: -// this.plainProxyUserSetter(); -// // Fall through -// case 4: -// this.plainProxyPassSetter(); + if (!outputFolder.isDirectory()) { + throw new OutputfolderNotADirectoryException(outputFolder); + } + } + // Fall through + case 1: + this.plainProxyHostSetter(); + // Fall through + case 2: + this.plainProxyPortSetter(); + // Fall through + // case 3: + // this.plainProxyUserSetter(); + // // Fall through + // case 4: + // this.plainProxyPassSetter(); } } - /* (non-Javadoc) + /* + * (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.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.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.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.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.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.lblProxyUser.setText(Messages.getString("advanced_config.ProxyUser")); //$NON-NLS-1$ -// this.txtProxyUser.setToolTipText(Messages -// .getString("advanced_config.ProxyUser_ToolTip")); //$NON-NLS-1$ -// this.txtProxyUser.setMessage(Messages -// .getString("advanced_config.ProxyUser_Template")); //$NON-NLS-1$ -// this.lblProxyPass.setText(Messages.getString("advanced_config.ProxyPass")); //$NON-NLS-1$ -// this.txtProxyPass.setToolTipText(Messages -// .getString("advanced_config.ProxyPass_ToolTip")); //$NON-NLS-1$ -// this.txtProxyPass.setMessage(Messages -// .getString("advanced_config.ProxyPass_Template")); //$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.lblProxyUser.setText(Messages.getString("advanced_config.ProxyUser")); + // //$NON-NLS-1$ + // this.txtProxyUser.setToolTipText(Messages + // .getString("advanced_config.ProxyUser_ToolTip")); //$NON-NLS-1$ + // this.txtProxyUser.setMessage(Messages + // .getString("advanced_config.ProxyUser_Template")); //$NON-NLS-1$ + // this.lblProxyPass.setText(Messages.getString("advanced_config.ProxyPass")); + // //$NON-NLS-1$ + // this.txtProxyPass.setToolTipText(Messages + // .getString("advanced_config.ProxyPass_ToolTip")); //$NON-NLS-1$ + // this.txtProxyPass.setMessage(Messages + // .getString("advanced_config.ProxyPass_Template")); //$NON-NLS-1$ } } -- cgit v1.2.3 From 6bb81343ac29b50a4dd3539ec2ceb007a732954c Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 15:29:31 +0100 Subject: AdvancedConfig extended --- .../composites/AdvancedConfigurationComposite.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 94474c66..4b32f59f 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 @@ -371,11 +371,12 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { GridLayout gl_grpSpeicherort = new GridLayout(3, false); grpSpeicherort.setLayout(gl_grpSpeicherort); FormData fd_grpSpeicherort = new FormData(); - fd_grpSpeicherort.left = new FormAttachment(100, -499); + fd_grpSpeicherort.left = new FormAttachment(0,5); fd_grpSpeicherort.top = new FormAttachment(this.grpBkuAuswahl, 5); fd_grpSpeicherort.right = new FormAttachment(100, -5); this.grpSpeicherort.setLayoutData(fd_grpSpeicherort); + FontData[] fD_grpSpeicherort = this.grpSpeicherort.getFont().getFontData(); fD_grpSpeicherort[0].setHeight(Constants.TEXT_SIZE_NORMAL); this.grpSpeicherort.setFont(new Font(Display.getCurrent(), fD_grpSpeicherort[0])); @@ -388,10 +389,10 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.txtOutputFolder = new Text(this.grpSpeicherort, SWT.BORDER); GridData gd_txtOutputFolder = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); - gd_txtOutputFolder.widthHint = 291; txtOutputFolder.setLayoutData(gd_txtOutputFolder); FontData[] fD_txtOutputFolder = this.txtOutputFolder.getFont().getFontData(); + fD_txtOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); this.txtOutputFolder.setFont(new Font(Display.getCurrent(), fD_txtOutputFolder[0])); this.txtOutputFolder.addFocusListener(new FocusAdapter() { @@ -402,14 +403,13 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { } }); fD_txtOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL); - // fD_btnBrowse[0].setHeight(Constants.TEXT_SIZE_BUTTON); this.btnBrowse = new Button(this.grpSpeicherort, SWT.NONE); btnBrowse.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); FontData[] fD_btnBrowse = this.btnBrowse.getFont().getFontData(); + fD_btnBrowse[0].setHeight(Constants.TEXT_SIZE_BUTTON); this.btnBrowse.setFont(new Font(Display.getCurrent(), fD_btnBrowse[0])); - this.btnBrowse.addSelectionListener(new SelectionAdapter() { @Override @@ -446,18 +446,18 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.BORDER); GridData gd_txtSaveFilePostFix = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); -// gd_txtSaveFilePostFix.widthHint = 256; + txtSaveFilePostFix.setLayoutData(gd_txtSaveFilePostFix); FontData[] fD_txtPostFix = this.txtSaveFilePostFix.getFont().getFontData(); + fD_txtPostFix[0].setHeight(Constants.TEXT_SIZE_NORMAL); this.txtSaveFilePostFix.setFont(new Font(Display.getCurrent(), fD_txtPostFix[0])); this.txtSaveFilePostFix.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { - // performOutputFolderChanged(AdvancedConfigurationComposite.this.txtSaveFilePostFix - // .getText()); + performPostFixChanged(AdvancedConfigurationComposite.this.txtSaveFilePostFix.getText()); } }); new Label(grpSpeicherort, SWT.NONE); @@ -649,6 +649,13 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { reloadResources(); } + private void performPostFixChanged(String postfix) { + + log.debug("Save file postfix changed to : {}", postfix); //$NON-NLS-1$ + this.configurationContainer.setSaveFilePostFix(postfix); + AdvancedConfigurationComposite.this.txtSaveFilePostFix.setText(postfix); + } + /* * (non-Javadoc) * -- cgit v1.2.3 From 0ac178bebfeed95af88de462f2c463f7569be9dd Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 15:42:02 +0100 Subject: Fixed GUI --- .../asit/pdfover/gui/composites/AdvancedConfigurationComposite.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 4b32f59f..0cb26983 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 @@ -388,7 +388,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.lblDefaultOutputFolder.setFont(new Font(Display.getCurrent(), fD_lblDefaultOutputFolder[0])); this.txtOutputFolder = new Text(this.grpSpeicherort, SWT.BORDER); - GridData gd_txtOutputFolder = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); + GridData gd_txtOutputFolder = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); txtOutputFolder.setLayoutData(gd_txtOutputFolder); FontData[] fD_txtOutputFolder = this.txtOutputFolder.getFont().getFontData(); @@ -445,7 +445,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { this.lblSaveFilePostFix.setFont(new Font(Display.getCurrent(), fD_lblSaveFilePostFix[0])); this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.BORDER); - GridData gd_txtSaveFilePostFix = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1); + GridData gd_txtSaveFilePostFix = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); txtSaveFilePostFix.setLayoutData(gd_txtSaveFilePostFix); -- cgit v1.2.3 From 402805f8485a926a8efd8d01de9af98824941140 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 16:30:36 +0100 Subject: Added Postfix option to the configuration --- .../pdfover/gui/composites/AdvancedConfigurationComposite.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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()); -- cgit v1.2.3 From 2d807da4f451b0b320c28193fe019680139f6840 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 19 Nov 2020 17:03:10 +0100 Subject: Adopted UI behaviour --- .../at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java') 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 8ed1b640..d2dabc5f 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 @@ -940,7 +940,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { case AMTSSIGNATURBLOCK: this.performPositionSelection(true); this.btnAutomatischePositionierung.setEnabled(false); - this.btnEnablePlaceholderUsage.setEnabled(true); + this.btnEnablePlaceholderUsage.setEnabled(false); this.performEnableUsePlaceholder(false); break; default: -- cgit v1.2.3