summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-03-23 14:56:03 +0100
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-03-23 14:56:03 +0100
commitc35e9d0864f95701d554c882bad4e8d808d0db27 (patch)
tree3d419428825d96ae24230c9bc04bf3aae3300c70 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java
parente881d03e656b5c2992fd5bc6f3357cb7fb3dc8ed (diff)
downloadpdf-over-c35e9d0864f95701d554c882bad4e8d808d0db27.tar.gz
pdf-over-c35e9d0864f95701d554c882bad4e8d808d0db27.tar.bz2
pdf-over-c35e9d0864f95701d554c882bad4e8d808d0db27.zip
accompanying GUI refactors
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java105
1 files changed, 53 insertions, 52 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java
index c2c1261b..1c894e5c 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AdvancedConfigurationComposite.java
@@ -46,6 +46,7 @@ import at.asit.pdfover.commons.Constants;
import at.asit.pdfover.commons.Messages;
import at.asit.pdfover.commons.Profile;
import at.asit.pdfover.gui.composites.ConfigurationComposite;
+import at.asit.pdfover.gui.composites.StateComposite;
import at.asit.pdfover.gui.controls.Dialog.BUTTONS;
import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.controls.ErrorMarker;
@@ -131,12 +132,12 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
layout.marginHeight = 10;
layout.marginWidth = 5;
this.grpSignatur.setLayout(layout);
- ConfigurationCompositeBase.anchor(grpSignatur).top(0,5).right(100,-5).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(grpSignatur, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(grpSignatur).top(0,5).right(100,-5).left(0,5).set();
+ StateComposite.setFontHeight(grpSignatur, Constants.TEXT_SIZE_NORMAL);
this.btnAutomatischePositionierung = new Button(this.grpSignatur, SWT.CHECK);
- ConfigurationCompositeBase.anchor(btnAutomatischePositionierung).right(100,-5).top(0).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(btnAutomatischePositionierung, Constants.TEXT_SIZE_BUTTON);
+ StateComposite.anchor(btnAutomatischePositionierung).right(100,-5).top(0).left(0,5).set();
+ StateComposite.setFontHeight(btnAutomatischePositionierung, Constants.TEXT_SIZE_BUTTON);
this.btnAutomatischePositionierung.addSelectionListener(new SelectionAdapter() {
@Override
@@ -147,8 +148,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
});
this.btnPdfACompat = new Button(this.grpSignatur, SWT.CHECK);
- ConfigurationCompositeBase.anchor(btnPdfACompat).right(100,-5).top(btnAutomatischePositionierung, 5).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(btnPdfACompat, Constants.TEXT_SIZE_BUTTON);
+ StateComposite.anchor(btnPdfACompat).right(100,-5).top(btnAutomatischePositionierung, 5).left(0,5).set();
+ StateComposite.setFontHeight(btnPdfACompat, Constants.TEXT_SIZE_BUTTON);
this.btnPdfACompat.addSelectionListener(new SelectionAdapter() {
@Override
@@ -159,19 +160,19 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
});
this.lblTransparenz = new Label(this.grpSignatur, SWT.HORIZONTAL);
- ConfigurationCompositeBase.anchor(lblTransparenz).top(btnPdfACompat, 5).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(lblTransparenz, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(lblTransparenz).top(btnPdfACompat, 5).left(0,5).set();
+ StateComposite.setFontHeight(lblTransparenz, Constants.TEXT_SIZE_NORMAL);
this.lblTransparenzLinks = new Label(this.grpSignatur, SWT.HORIZONTAL);
- ConfigurationCompositeBase.anchor(lblTransparenzLinks).top(lblTransparenz, 5).left(0,15).set();
- ConfigurationCompositeBase.setFontHeight(lblTransparenzLinks, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(lblTransparenzLinks).top(lblTransparenz, 5).left(0,15).set();
+ StateComposite.setFontHeight(lblTransparenzLinks, Constants.TEXT_SIZE_NORMAL);
this.lblTransparenzRechts = new Label(this.grpSignatur, SWT.HORIZONTAL);
- ConfigurationCompositeBase.anchor(lblTransparenzRechts).top(lblTransparenz, 5).right(100,-5).set();
- ConfigurationCompositeBase.setFontHeight(lblTransparenzRechts, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(lblTransparenzRechts).top(lblTransparenz, 5).right(100,-5).set();
+ StateComposite.setFontHeight(lblTransparenzRechts, Constants.TEXT_SIZE_NORMAL);
this.sclTransparenz = new Scale(this.grpSignatur, SWT.HORIZONTAL);
- ConfigurationCompositeBase.anchor(sclTransparenz).right(lblTransparenzRechts, -5).top(lblTransparenz, 5).left(lblTransparenzLinks, 5).set();
+ StateComposite.anchor(sclTransparenz).right(lblTransparenzRechts, -5).top(lblTransparenz, 5).left(lblTransparenzLinks, 5).set();
this.sclTransparenz.setMinimum(0);
this.sclTransparenz.setMaximum(255);
this.sclTransparenz.setIncrement(1);
@@ -188,12 +189,12 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
layout_grpPlaceholder.marginHeight = 10;
layout_grpPlaceholder.marginWidth = 5;
this.grpPlaceholder.setLayout(layout_grpPlaceholder);
- ConfigurationCompositeBase.anchor(grpPlaceholder).top(grpSignatur, 5).left(0,5).right(100,-5).set();
- ConfigurationCompositeBase.setFontHeight(grpPlaceholder, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(grpPlaceholder).top(grpSignatur, 5).left(0,5).right(100,-5).set();
+ StateComposite.setFontHeight(grpPlaceholder, Constants.TEXT_SIZE_NORMAL);
this.btnEnablePlaceholderUsage = new Button(this.grpPlaceholder, SWT.CHECK);
- ConfigurationCompositeBase.anchor(btnEnablePlaceholderUsage).top(0,5).left(0,5).right(100,-5).set();
- ConfigurationCompositeBase.setFontHeight(btnEnablePlaceholderUsage, Constants.TEXT_SIZE_BUTTON);
+ StateComposite.anchor(btnEnablePlaceholderUsage).top(0,5).left(0,5).right(100,-5).set();
+ StateComposite.setFontHeight(btnEnablePlaceholderUsage, Constants.TEXT_SIZE_BUTTON);
this.btnEnablePlaceholderUsage.addSelectionListener(new SelectionAdapter() {
@Override
@@ -205,8 +206,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
});
this.btnPlatzhalterVerwenden = new Button(this.grpPlaceholder, SWT.RADIO);
- ConfigurationCompositeBase.anchor(btnPlatzhalterVerwenden).right(100,-5).top(btnEnablePlaceholderUsage,5).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(btnPlatzhalterVerwenden, Constants.TEXT_SIZE_BUTTON);
+ StateComposite.anchor(btnPlatzhalterVerwenden).right(100,-5).top(btnEnablePlaceholderUsage,5).left(0,5).set();
+ StateComposite.setFontHeight(btnPlatzhalterVerwenden, Constants.TEXT_SIZE_BUTTON);
this.btnPlatzhalterVerwenden.addSelectionListener(new SelectionAdapter() {
@Override
@@ -217,8 +218,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
});
this.btnSignatureFieldsUsage = new Button(this.grpPlaceholder, SWT.RADIO);
- ConfigurationCompositeBase.anchor(btnSignatureFieldsUsage).right(100,-5).top(btnPlatzhalterVerwenden, 5).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(btnSignatureFieldsUsage, Constants.TEXT_SIZE_BUTTON);
+ StateComposite.anchor(btnSignatureFieldsUsage).right(100,-5).top(btnPlatzhalterVerwenden, 5).left(0,5).set();
+ StateComposite.setFontHeight(btnSignatureFieldsUsage, Constants.TEXT_SIZE_BUTTON);
this.btnSignatureFieldsUsage.addSelectionListener(new SelectionAdapter() {
@Override
@@ -233,12 +234,12 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
layout.marginHeight = 10;
layout.marginWidth = 5;
this.grpBkuAuswahl.setLayout(layout);
- ConfigurationCompositeBase.anchor(grpBkuAuswahl).top(grpPlaceholder, 5).left(0,5).right(100,-5).set();
- ConfigurationCompositeBase.setFontHeight(grpBkuAuswahl, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(grpBkuAuswahl).top(grpPlaceholder, 5).left(0,5).right(100,-5).set();
+ StateComposite.setFontHeight(grpBkuAuswahl, Constants.TEXT_SIZE_NORMAL);
this.cmbBKUAuswahl = new Combo(this.grpBkuAuswahl, SWT.READ_ONLY);
- ConfigurationCompositeBase.anchor(cmbBKUAuswahl).right(100,-5).top(0).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(cmbBKUAuswahl, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(cmbBKUAuswahl).right(100,-5).top(0).left(0,5).set();
+ StateComposite.setFontHeight(cmbBKUAuswahl, Constants.TEXT_SIZE_NORMAL);
this.bkuStrings = Arrays.stream(BKUs.values()).map(s -> Messages.getString("BKU."+s)).collect(Collectors.toList());
this.cmbBKUAuswahl.setItems(bkuStrings.toArray(new String[0]));
@@ -256,8 +257,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
});
this.btnKeystoreEnabled = new Button(this.grpBkuAuswahl, SWT.CHECK);
- ConfigurationCompositeBase.anchor(btnKeystoreEnabled).right(100,-5).top(cmbBKUAuswahl,5).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(btnKeystoreEnabled, Constants.TEXT_SIZE_BUTTON);
+ StateComposite.anchor(btnKeystoreEnabled).right(100,-5).top(cmbBKUAuswahl,5).left(0,5).set();
+ StateComposite.setFontHeight(btnKeystoreEnabled, Constants.TEXT_SIZE_BUTTON);
this.btnKeystoreEnabled.addSelectionListener(new SelectionAdapter() {
@Override
@@ -269,15 +270,15 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
this.grpSpeicherort = new Group(this, SWT.NONE);
grpSpeicherort.setLayout(new GridLayout(3, false));
- ConfigurationCompositeBase.anchor(grpSpeicherort).left(0,5).top(grpBkuAuswahl, 5).right(100,-5).set();
- ConfigurationCompositeBase.setFontHeight(grpSpeicherort, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(grpSpeicherort).left(0,5).top(grpBkuAuswahl, 5).right(100,-5).set();
+ StateComposite.setFontHeight(grpSpeicherort, Constants.TEXT_SIZE_NORMAL);
this.lblDefaultOutputFolder = new Label(this.grpSpeicherort, SWT.NONE);
- ConfigurationCompositeBase.setFontHeight(lblDefaultOutputFolder, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.setFontHeight(lblDefaultOutputFolder, Constants.TEXT_SIZE_NORMAL);
this.txtOutputFolder = new Text(this.grpSpeicherort, SWT.BORDER);
txtOutputFolder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- ConfigurationCompositeBase.setFontHeight(txtOutputFolder, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.setFontHeight(txtOutputFolder, Constants.TEXT_SIZE_NORMAL);
this.txtOutputFolder.addFocusListener(new FocusAdapter() {
@Override
@@ -288,7 +289,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
this.btnBrowse = new Button(this.grpSpeicherort, SWT.NONE);
btnBrowse.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
- ConfigurationCompositeBase.setFontHeight(btnBrowse, Constants.TEXT_SIZE_BUTTON);
+ StateComposite.setFontHeight(btnBrowse, Constants.TEXT_SIZE_BUTTON);
this.btnBrowse.addSelectionListener(new SelectionAdapter() {
@Override
@@ -318,11 +319,11 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
this.lblSaveFilePostFix = new Label(this.grpSpeicherort, SWT.NONE);
lblSaveFilePostFix.setText(Messages.getString("AdvancedConfigurationComposite.lblSaveFilePostFix.text"));
- ConfigurationCompositeBase.setFontHeight(lblSaveFilePostFix, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.setFontHeight(lblSaveFilePostFix, Constants.TEXT_SIZE_NORMAL);
this.txtSaveFilePostFix = new Text(this.grpSpeicherort, SWT.BORDER);
txtSaveFilePostFix.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- ConfigurationCompositeBase.setFontHeight(txtSaveFilePostFix, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.setFontHeight(txtSaveFilePostFix, Constants.TEXT_SIZE_NORMAL);
this.txtSaveFilePostFix.addFocusListener(new FocusAdapter() {
@Override
@@ -336,12 +337,12 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
layout_grpLocaleAuswahl.marginHeight = 10;
layout_grpLocaleAuswahl.marginWidth = 5;
this.grpLocaleAuswahl.setLayout(layout_grpLocaleAuswahl);
- ConfigurationCompositeBase.anchor(grpLocaleAuswahl).top(grpSpeicherort, 5).left(0,5).right(100,-5).set();
- ConfigurationCompositeBase.setFontHeight(grpLocaleAuswahl, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(grpLocaleAuswahl).top(grpSpeicherort, 5).left(0,5).right(100,-5).set();
+ StateComposite.setFontHeight(grpLocaleAuswahl, Constants.TEXT_SIZE_NORMAL);
this.cmbLocaleAuswahl = new Combo(this.grpLocaleAuswahl, SWT.READ_ONLY);
- ConfigurationCompositeBase.anchor(cmbLocaleAuswahl).right(100,-5).top(0).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(cmbLocaleAuswahl, Constants.TEXT_SIZE_NORMAL);;
+ StateComposite.anchor(cmbLocaleAuswahl).right(100,-5).top(0).left(0,5).set();
+ StateComposite.setFontHeight(cmbLocaleAuswahl, Constants.TEXT_SIZE_NORMAL);;
this.cmbLocaleAuswahl.setItems(Arrays.stream(Constants.SUPPORTED_LOCALES).map(l -> l.getDisplayLanguage()).toArray(String[]::new));
this.cmbLocaleAuswahl.addSelectionListener(new SelectionAdapter() {
@@ -361,12 +362,12 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
layout_grpUpdateCheck.marginHeight = 10;
layout_grpUpdateCheck.marginWidth = 5;
this.grpUpdateCheck.setLayout(layout_grpUpdateCheck);
- ConfigurationCompositeBase.anchor(grpUpdateCheck).top(grpLocaleAuswahl, 5).left(0,5).right(100,-5).set();
- ConfigurationCompositeBase.setFontHeight(grpUpdateCheck, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(grpUpdateCheck).top(grpLocaleAuswahl, 5).left(0,5).right(100,-5).set();
+ StateComposite.setFontHeight(grpUpdateCheck, Constants.TEXT_SIZE_NORMAL);
this.btnUpdateCheck = new Button(this.grpUpdateCheck, SWT.CHECK);
- ConfigurationCompositeBase.anchor(btnUpdateCheck).right(100,-5).top(0).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(btnUpdateCheck, Constants.TEXT_SIZE_BUTTON);
+ StateComposite.anchor(btnUpdateCheck).right(100,-5).top(0).left(0,5).set();
+ StateComposite.setFontHeight(btnUpdateCheck, Constants.TEXT_SIZE_BUTTON);
this.btnUpdateCheck.addSelectionListener(new SelectionAdapter() {
@Override
@@ -376,9 +377,9 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
});
this.grpProxy = new Group(this, SWT.NONE);
- ConfigurationCompositeBase.anchor(grpProxy).right(100,-5).top(grpUpdateCheck, 5).left(0,5).set();
+ StateComposite.anchor(grpProxy).right(100,-5).top(grpUpdateCheck, 5).left(0,5).set();
this.grpProxy.setLayout(new GridLayout(2, false));
- ConfigurationCompositeBase.setFontHeight(grpProxy, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.setFontHeight(grpProxy, Constants.TEXT_SIZE_NORMAL);
this.lblProxyHost = new Label(this.grpProxy, SWT.NONE);
do { /* grid positioning */
@@ -387,18 +388,18 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
this.lblProxyHost.setLayoutData(gd_lblProxyHost);
this.lblProxyHost.setBounds(0, 0, 57, 15);
} while (false);
- ConfigurationCompositeBase.setFontHeight(lblProxyHost, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.setFontHeight(lblProxyHost, Constants.TEXT_SIZE_NORMAL);
Composite compProxyHostContainer = new Composite(this.grpProxy, SWT.NONE);
compProxyHostContainer.setLayout(new FormLayout());
compProxyHostContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
this.txtProxyHost = new Text(compProxyHostContainer, SWT.BORDER);
- ConfigurationCompositeBase.anchor(txtProxyHost).right(100,-42).top(0).left(0,5).set();
- ConfigurationCompositeBase.setFontHeight(txtProxyHost, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(txtProxyHost).right(100,-42).top(0).left(0,5).set();
+ StateComposite.setFontHeight(txtProxyHost, Constants.TEXT_SIZE_NORMAL);
this.proxyHostErrorMarker = new ErrorMarker(compProxyHostContainer, SWT.NONE, ""); //$NON-NLS-1$
- ConfigurationCompositeBase.anchor(proxyHostErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set();
+ StateComposite.anchor(proxyHostErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set();
this.proxyHostErrorMarker.setVisible(false);
this.txtProxyHost.addFocusListener(new FocusAdapter() {
@@ -416,15 +417,15 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
this.lblProxyPort = new Label(this.grpProxy, SWT.NONE);
this.lblProxyPort.setBounds(0, 0, 57, 15);
- ConfigurationCompositeBase.setFontHeight(lblProxyPort, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.setFontHeight(lblProxyPort, Constants.TEXT_SIZE_NORMAL);
Composite compProxyPortContainer = new Composite(this.grpProxy, SWT.NONE);
compProxyPortContainer.setLayout(new FormLayout());
compProxyPortContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
this.txtProxyPort = new Text(compProxyPortContainer, SWT.BORDER);
- ConfigurationCompositeBase.anchor(txtProxyPort).top(0,0).left(0,5).right(100,-42).set();
- ConfigurationCompositeBase.setFontHeight(txtProxyPort, Constants.TEXT_SIZE_NORMAL);
+ StateComposite.anchor(txtProxyPort).top(0,0).left(0,5).right(100,-42).set();
+ StateComposite.setFontHeight(txtProxyPort, Constants.TEXT_SIZE_NORMAL);
this.txtProxyPort.addTraverseListener(e -> {
if (e.detail == SWT.TRAVERSE_RETURN) {
@@ -433,7 +434,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase {
});
this.txtProxyPortErrorMarker = new ErrorMarker(compProxyPortContainer, SWT.NONE, ""); //$NON-NLS-1$
- ConfigurationCompositeBase.anchor(txtProxyPortErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set();
+ StateComposite.anchor(txtProxyPortErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set();
this.txtProxyPortErrorMarker.setVisible(false);
this.txtProxyPort.addFocusListener(new FocusAdapter() {