From 2624ca21244979af6118879dd4fd818f9c0b7383 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Thu, 4 Aug 2022 11:30:17 +0200 Subject: SWT helper refactor: - move out of StateComposite to its own SWTUtils class - refactor to reflection (better than one overload for each SWT type...) --- .../composites/configuration/AboutComposite.java | 20 ++-- .../AdvancedConfigurationComposite.java | 112 ++++++++++----------- .../KeystoreConfigurationComposite.java | 68 ++++++------- .../SimpleConfigurationComposite.java | 66 ++++++------ 4 files changed, 133 insertions(+), 133 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java index 1f1cc1ba..2582cf17 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/AboutComposite.java @@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.commons.Constants; import at.asit.pdfover.commons.Messages; -import at.asit.pdfover.gui.composites.StateComposite; +import at.asit.pdfover.gui.utils.SWTUtils; import at.asit.pdfover.gui.workflow.config.ConfigurationManager; public class AboutComposite extends ConfigurationCompositeBase { @@ -39,21 +39,21 @@ public class AboutComposite extends ConfigurationCompositeBase { setLayout(new FormLayout()); this.lnkAbout = new Link(this, SWT.WRAP); - StateComposite.anchor(lnkAbout).top(0,5).right(100,-5).left(0,5).set(); - StateComposite.setFontHeight(lnkAbout, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(lnkAbout).top(0,5).right(100,-5).left(0,5).set(); + SWTUtils.setFontHeight(lnkAbout, Constants.TEXT_SIZE_NORMAL); this.lblDataProtection = new Label(this, SWT.WRAP); - StateComposite.anchor(lblDataProtection).top(lnkAbout, 15).left(0,5).right(100,-5).set(); - StateComposite.setFontHeight(lblDataProtection, Constants.TEXT_SIZE_BIG); - StateComposite.setFontStyle(lblDataProtection, SWT.BOLD); + SWTUtils.anchor(lblDataProtection).top(lnkAbout, 15).left(0,5).right(100,-5).set(); + SWTUtils.setFontHeight(lblDataProtection, Constants.TEXT_SIZE_BIG); + SWTUtils.setFontStyle(lblDataProtection, SWT.BOLD); this.lnkDataProtection = new Link(this, SWT.WRAP); - StateComposite.anchor(lnkDataProtection).top(lblDataProtection,10).left(0,5).right(100,-5).set(); - StateComposite.setFontHeight(lnkDataProtection, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(lnkDataProtection).top(lblDataProtection,10).left(0,5).right(100,-5).set(); + SWTUtils.setFontHeight(lnkDataProtection, Constants.TEXT_SIZE_NORMAL); this.btnOpenLogDirectory = new Button(this, SWT.NONE); - StateComposite.anchor(btnOpenLogDirectory).bottom(100, -5).right(100, -5).set(); - StateComposite.setFontHeight(btnOpenLogDirectory, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnOpenLogDirectory).bottom(100, -5).right(100, -5).set(); + SWTUtils.setFontHeight(btnOpenLogDirectory, Constants.TEXT_SIZE_BUTTON); this.lnkAbout.addSelectionListener(new SelectionAdapter() { @Override 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 e9776846..66ad128a 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,13 +46,13 @@ 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; import at.asit.pdfover.gui.exceptions.InvalidPortException; import at.asit.pdfover.gui.exceptions.OutputfolderDoesntExistException; import at.asit.pdfover.gui.exceptions.OutputfolderNotADirectoryException; +import at.asit.pdfover.gui.utils.SWTUtils; import at.asit.pdfover.gui.workflow.config.ConfigurationManager; import at.asit.pdfover.gui.workflow.config.ConfigurationDataInMemory; import at.asit.pdfover.gui.workflow.states.State; @@ -130,12 +130,12 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { layout.marginHeight = 10; layout.marginWidth = 5; this.grpSignatur.setLayout(layout); - StateComposite.anchor(grpSignatur).top(0,5).right(100,-5).left(0,5).set(); - StateComposite.setFontHeight(grpSignatur, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(grpSignatur).top(0,5).right(100,-5).left(0,5).set(); + SWTUtils.setFontHeight(grpSignatur, Constants.TEXT_SIZE_NORMAL); this.btnAutomatischePositionierung = new Button(this.grpSignatur, SWT.CHECK); - StateComposite.anchor(btnAutomatischePositionierung).right(100,-5).top(0).left(0,5).set(); - StateComposite.setFontHeight(btnAutomatischePositionierung, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnAutomatischePositionierung).right(100,-5).top(0).left(0,5).set(); + SWTUtils.setFontHeight(btnAutomatischePositionierung, Constants.TEXT_SIZE_BUTTON); this.btnAutomatischePositionierung.addSelectionListener(new SelectionAdapter() { @Override @@ -146,8 +146,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { }); this.btnPdfACompat = new Button(this.grpSignatur, SWT.CHECK); - StateComposite.anchor(btnPdfACompat).right(100,-5).top(btnAutomatischePositionierung, 5).left(0,5).set(); - StateComposite.setFontHeight(btnPdfACompat, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnPdfACompat).right(100,-5).top(btnAutomatischePositionierung, 5).left(0,5).set(); + SWTUtils.setFontHeight(btnPdfACompat, Constants.TEXT_SIZE_BUTTON); this.btnPdfACompat.addSelectionListener(new SelectionAdapter() { @Override @@ -158,24 +158,24 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { }); this.lblTransparenz = new Label(this.grpSignatur, SWT.HORIZONTAL); - StateComposite.anchor(lblTransparenz).top(btnPdfACompat, 5).left(0,5).set(); - StateComposite.setFontHeight(lblTransparenz, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(lblTransparenz).top(btnPdfACompat, 5).left(0,5).set(); + SWTUtils.setFontHeight(lblTransparenz, Constants.TEXT_SIZE_NORMAL); this.lblTransparenzLinks = new Label(this.grpSignatur, SWT.HORIZONTAL); - StateComposite.anchor(lblTransparenzLinks).top(lblTransparenz, 5).left(0,15).set(); - StateComposite.setFontHeight(lblTransparenzLinks, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(lblTransparenzLinks).top(lblTransparenz, 5).left(0,15).set(); + SWTUtils.setFontHeight(lblTransparenzLinks, Constants.TEXT_SIZE_NORMAL); this.lblTransparenzRechts = new Label(this.grpSignatur, SWT.HORIZONTAL); - StateComposite.anchor(lblTransparenzRechts).top(lblTransparenz, 5).right(100,-5).set(); - StateComposite.setFontHeight(lblTransparenzRechts, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(lblTransparenzRechts).top(lblTransparenz, 5).right(100,-5).set(); + SWTUtils.setFontHeight(lblTransparenzRechts, Constants.TEXT_SIZE_NORMAL); this.sclTransparenz = new Scale(this.grpSignatur, SWT.HORIZONTAL); - StateComposite.anchor(sclTransparenz).right(lblTransparenzRechts, -5).top(lblTransparenz, 5).left(lblTransparenzLinks, 5).set(); + SWTUtils.anchor(sclTransparenz).right(lblTransparenzRechts, -5).top(lblTransparenz, 5).left(lblTransparenzLinks, 5).set(); this.sclTransparenz.setMinimum(0); this.sclTransparenz.setMaximum(255); this.sclTransparenz.setIncrement(1); this.sclTransparenz.setPageIncrement(10); - StateComposite.disableEventDefault(sclTransparenz, SWT.MouseVerticalWheel); + SWTUtils.disableEventDefault(sclTransparenz, SWT.MouseVerticalWheel); this.sclTransparenz.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -188,12 +188,12 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { layout_grpPlaceholder.marginHeight = 10; layout_grpPlaceholder.marginWidth = 5; this.grpPlaceholder.setLayout(layout_grpPlaceholder); - StateComposite.anchor(grpPlaceholder).top(grpSignatur, 5).left(0,5).right(100,-5).set(); - StateComposite.setFontHeight(grpPlaceholder, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(grpPlaceholder).top(grpSignatur, 5).left(0,5).right(100,-5).set(); + SWTUtils.setFontHeight(grpPlaceholder, Constants.TEXT_SIZE_NORMAL); this.btnEnablePlaceholderUsage = new Button(this.grpPlaceholder, SWT.CHECK); - StateComposite.anchor(btnEnablePlaceholderUsage).top(0,5).left(0,5).right(100,-5).set(); - StateComposite.setFontHeight(btnEnablePlaceholderUsage, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnEnablePlaceholderUsage).top(0,5).left(0,5).right(100,-5).set(); + SWTUtils.setFontHeight(btnEnablePlaceholderUsage, Constants.TEXT_SIZE_BUTTON); this.btnEnablePlaceholderUsage.addSelectionListener(new SelectionAdapter() { @Override @@ -205,8 +205,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { }); this.btnPlatzhalterVerwenden = new Button(this.grpPlaceholder, SWT.RADIO); - StateComposite.anchor(btnPlatzhalterVerwenden).right(100,-5).top(btnEnablePlaceholderUsage,5).left(0,5).set(); - StateComposite.setFontHeight(btnPlatzhalterVerwenden, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnPlatzhalterVerwenden).right(100,-5).top(btnEnablePlaceholderUsage,5).left(0,5).set(); + SWTUtils.setFontHeight(btnPlatzhalterVerwenden, Constants.TEXT_SIZE_BUTTON); this.btnPlatzhalterVerwenden.addSelectionListener(new SelectionAdapter() { @Override @@ -217,8 +217,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { }); this.btnSignatureFieldsUsage = new Button(this.grpPlaceholder, SWT.RADIO); - StateComposite.anchor(btnSignatureFieldsUsage).right(100,-5).top(btnPlatzhalterVerwenden, 5).left(0,5).set(); - StateComposite.setFontHeight(btnSignatureFieldsUsage, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnSignatureFieldsUsage).right(100,-5).top(btnPlatzhalterVerwenden, 5).left(0,5).set(); + SWTUtils.setFontHeight(btnSignatureFieldsUsage, Constants.TEXT_SIZE_BUTTON); this.btnSignatureFieldsUsage.addSelectionListener(new SelectionAdapter() { @Override @@ -233,13 +233,13 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { layout.marginHeight = 10; layout.marginWidth = 5; this.grpBkuAuswahl.setLayout(layout); - StateComposite.anchor(grpBkuAuswahl).top(grpPlaceholder, 5).left(0,5).right(100,-5).set(); - StateComposite.setFontHeight(grpBkuAuswahl, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(grpBkuAuswahl).top(grpPlaceholder, 5).left(0,5).right(100,-5).set(); + SWTUtils.setFontHeight(grpBkuAuswahl, Constants.TEXT_SIZE_NORMAL); this.cmbBKUAuswahl = new Combo(this.grpBkuAuswahl, SWT.READ_ONLY); - StateComposite.anchor(cmbBKUAuswahl).right(100,-5).top(0).left(0,5).set(); - StateComposite.setFontHeight(cmbBKUAuswahl, Constants.TEXT_SIZE_NORMAL); - StateComposite.disableEventDefault(cmbBKUAuswahl, SWT.MouseVerticalWheel); + SWTUtils.anchor(cmbBKUAuswahl).right(100,-5).top(0).left(0,5).set(); + SWTUtils.setFontHeight(cmbBKUAuswahl, Constants.TEXT_SIZE_NORMAL); + SWTUtils.disableEventDefault(cmbBKUAuswahl, SWT.MouseVerticalWheel); this.bkuStrings = Arrays.stream(BKUs.values()).map(s -> Messages.getString("BKU."+s)).collect(Collectors.toList()); this.cmbBKUAuswahl.setItems(bkuStrings.toArray(new String[0])); @@ -257,8 +257,8 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { }); this.btnKeystoreEnabled = new Button(this.grpBkuAuswahl, SWT.CHECK); - StateComposite.anchor(btnKeystoreEnabled).right(100,-5).top(cmbBKUAuswahl,5).left(0,5).set(); - StateComposite.setFontHeight(btnKeystoreEnabled, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnKeystoreEnabled).right(100,-5).top(cmbBKUAuswahl,5).left(0,5).set(); + SWTUtils.setFontHeight(btnKeystoreEnabled, Constants.TEXT_SIZE_BUTTON); this.btnKeystoreEnabled.addSelectionListener(new SelectionAdapter() { @Override @@ -270,15 +270,15 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { this.grpSpeicherort = new Group(this, SWT.NONE); grpSpeicherort.setLayout(new GridLayout(3, false)); - StateComposite.anchor(grpSpeicherort).left(0,5).top(grpBkuAuswahl, 5).right(100,-5).set(); - StateComposite.setFontHeight(grpSpeicherort, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(grpSpeicherort).left(0,5).top(grpBkuAuswahl, 5).right(100,-5).set(); + SWTUtils.setFontHeight(grpSpeicherort, Constants.TEXT_SIZE_NORMAL); this.lblDefaultOutputFolder = new Label(this.grpSpeicherort, SWT.NONE); - StateComposite.setFontHeight(lblDefaultOutputFolder, Constants.TEXT_SIZE_NORMAL); + SWTUtils.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)); - StateComposite.setFontHeight(txtOutputFolder, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(txtOutputFolder, Constants.TEXT_SIZE_NORMAL); this.txtOutputFolder.addFocusListener(new FocusAdapter() { @Override @@ -289,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)); - StateComposite.setFontHeight(btnBrowse, Constants.TEXT_SIZE_BUTTON); + SWTUtils.setFontHeight(btnBrowse, Constants.TEXT_SIZE_BUTTON); this.btnBrowse.addSelectionListener(new SelectionAdapter() { @Override @@ -319,11 +319,11 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { this.lblSaveFilePostFix = new Label(this.grpSpeicherort, SWT.NONE); lblSaveFilePostFix.setText(Messages.getString("AdvancedConfigurationComposite.lblSaveFilePostFix.text")); - StateComposite.setFontHeight(lblSaveFilePostFix, Constants.TEXT_SIZE_NORMAL); + SWTUtils.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)); - StateComposite.setFontHeight(txtSaveFilePostFix, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(txtSaveFilePostFix, Constants.TEXT_SIZE_NORMAL); this.txtSaveFilePostFix.addFocusListener(new FocusAdapter() { @Override @@ -337,14 +337,14 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { layout_grpLocaleAuswahl.marginHeight = 10; layout_grpLocaleAuswahl.marginWidth = 5; this.grpLocaleAuswahl.setLayout(layout_grpLocaleAuswahl); - StateComposite.anchor(grpLocaleAuswahl).top(grpSpeicherort, 5).left(0,5).right(100,-5).set(); - StateComposite.setFontHeight(grpLocaleAuswahl, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(grpLocaleAuswahl).top(grpSpeicherort, 5).left(0,5).right(100,-5).set(); + SWTUtils.setFontHeight(grpLocaleAuswahl, Constants.TEXT_SIZE_NORMAL); this.cmbLocaleAuswahl = new Combo(this.grpLocaleAuswahl, SWT.READ_ONLY); - StateComposite.anchor(cmbLocaleAuswahl).right(100,-5).top(0).left(0,5).set(); - StateComposite.setFontHeight(cmbLocaleAuswahl, Constants.TEXT_SIZE_NORMAL);; + SWTUtils.anchor(cmbLocaleAuswahl).right(100,-5).top(0).left(0,5).set(); + SWTUtils.setFontHeight(cmbLocaleAuswahl, Constants.TEXT_SIZE_NORMAL);; this.cmbLocaleAuswahl.setItems(Arrays.stream(Constants.SUPPORTED_LOCALES).map(l -> l.getDisplayLanguage()).toArray(String[]::new)); - StateComposite.disableEventDefault(cmbLocaleAuswahl, SWT.MouseVerticalWheel); + SWTUtils.disableEventDefault(cmbLocaleAuswahl, SWT.MouseVerticalWheel); this.cmbLocaleAuswahl.addSelectionListener(new SelectionAdapter() { @Override @@ -363,12 +363,12 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { layout_grpUpdateCheck.marginHeight = 10; layout_grpUpdateCheck.marginWidth = 5; this.grpUpdateCheck.setLayout(layout_grpUpdateCheck); - StateComposite.anchor(grpUpdateCheck).top(grpLocaleAuswahl, 5).left(0,5).right(100,-5).set(); - StateComposite.setFontHeight(grpUpdateCheck, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(grpUpdateCheck).top(grpLocaleAuswahl, 5).left(0,5).right(100,-5).set(); + SWTUtils.setFontHeight(grpUpdateCheck, Constants.TEXT_SIZE_NORMAL); this.btnUpdateCheck = new Button(this.grpUpdateCheck, SWT.CHECK); - StateComposite.anchor(btnUpdateCheck).right(100,-5).top(0).left(0,5).set(); - StateComposite.setFontHeight(btnUpdateCheck, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnUpdateCheck).right(100,-5).top(0).left(0,5).set(); + SWTUtils.setFontHeight(btnUpdateCheck, Constants.TEXT_SIZE_BUTTON); this.btnUpdateCheck.addSelectionListener(new SelectionAdapter() { @Override @@ -378,9 +378,9 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { }); this.grpProxy = new Group(this, SWT.NONE); - StateComposite.anchor(grpProxy).right(100,-5).top(grpUpdateCheck, 5).left(0,5).set(); + SWTUtils.anchor(grpProxy).right(100,-5).top(grpUpdateCheck, 5).left(0,5).set(); this.grpProxy.setLayout(new GridLayout(2, false)); - StateComposite.setFontHeight(grpProxy, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(grpProxy, Constants.TEXT_SIZE_NORMAL); this.lblProxyHost = new Label(this.grpProxy, SWT.NONE); do { /* grid positioning */ @@ -389,18 +389,18 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { this.lblProxyHost.setLayoutData(gd_lblProxyHost); this.lblProxyHost.setBounds(0, 0, 57, 15); } while (false); - StateComposite.setFontHeight(lblProxyHost, Constants.TEXT_SIZE_NORMAL); + SWTUtils.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); - StateComposite.anchor(txtProxyHost).right(100,-42).top(0).left(0,5).set(); - StateComposite.setFontHeight(txtProxyHost, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(txtProxyHost).right(100,-42).top(0).left(0,5).set(); + SWTUtils.setFontHeight(txtProxyHost, Constants.TEXT_SIZE_NORMAL); this.proxyHostErrorMarker = new ErrorMarker(compProxyHostContainer, SWT.NONE, ""); - StateComposite.anchor(proxyHostErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set(); + SWTUtils.anchor(proxyHostErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set(); this.proxyHostErrorMarker.setVisible(false); this.txtProxyHost.addFocusListener(new FocusAdapter() { @@ -418,15 +418,15 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { this.lblProxyPort = new Label(this.grpProxy, SWT.NONE); this.lblProxyPort.setBounds(0, 0, 57, 15); - StateComposite.setFontHeight(lblProxyPort, Constants.TEXT_SIZE_NORMAL); + SWTUtils.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); - StateComposite.anchor(txtProxyPort).top(0,0).left(0,5).right(100,-42).set(); - StateComposite.setFontHeight(txtProxyPort, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(txtProxyPort).top(0,0).left(0,5).right(100,-42).set(); + SWTUtils.setFontHeight(txtProxyPort, Constants.TEXT_SIZE_NORMAL); this.txtProxyPort.addTraverseListener(e -> { if (e.detail == SWT.TRAVERSE_RETURN) { @@ -435,7 +435,7 @@ public class AdvancedConfigurationComposite extends ConfigurationCompositeBase { }); this.txtProxyPortErrorMarker = new ErrorMarker(compProxyPortContainer, SWT.NONE, ""); - StateComposite.anchor(txtProxyPortErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set(); + SWTUtils.anchor(txtProxyPortErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set(); this.txtProxyPortErrorMarker.setVisible(false); this.txtProxyPort.addFocusListener(new FocusAdapter() { diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java index 14100128..1d1efb06 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/KeystoreConfigurationComposite.java @@ -50,7 +50,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.commons.Constants; -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.PasswordInputDialog; @@ -60,6 +59,7 @@ import at.asit.pdfover.gui.exceptions.KeystoreAliasNoKeyException; import at.asit.pdfover.gui.exceptions.KeystoreDoesntExistException; import at.asit.pdfover.gui.exceptions.KeystoreKeyPasswordException; import at.asit.pdfover.gui.keystore.KeystoreUtils; +import at.asit.pdfover.gui.utils.SWTUtils; import at.asit.pdfover.commons.Messages; import at.asit.pdfover.gui.workflow.config.ConfigurationManager; import at.asit.pdfover.gui.workflow.config.ConfigurationDataInMemory.KeyStorePassStorageType; @@ -112,70 +112,70 @@ public class KeystoreConfigurationComposite extends ConfigurationCompositeBase { layout.marginWidth = 5; this.grpKeystore.setLayout(layout); - StateComposite.anchor(grpKeystore).top(0,5).left(0,5).right(100,-5).set(); - StateComposite.setFontHeight(this.grpKeystore, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(grpKeystore).top(0,5).left(0,5).right(100,-5).set(); + SWTUtils.setFontHeight(this.grpKeystore, Constants.TEXT_SIZE_NORMAL); this.lblKeystoreFile = new Label(this.grpKeystore, SWT.NONE); - StateComposite.anchor(lblKeystoreFile).top(0).left(0,5).set(); + SWTUtils.anchor(lblKeystoreFile).top(0).left(0,5).set(); FormData fd_lblKeystoreFile = new FormData(); fd_lblKeystoreFile.top = new FormAttachment(0); fd_lblKeystoreFile.left = new FormAttachment(0, 5); this.lblKeystoreFile.setLayoutData(fd_lblKeystoreFile); - StateComposite.setFontHeight(lblKeystoreFile, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(lblKeystoreFile, Constants.TEXT_SIZE_NORMAL); this.txtKeystoreFile = new Text(grpKeystore, SWT.BORDER); this.btnBrowse = new Button(grpKeystore, SWT.NONE); - StateComposite.setFontHeight(txtKeystoreFile, Constants.TEXT_SIZE_NORMAL); - StateComposite.setFontHeight(btnBrowse, Constants.TEXT_SIZE_BUTTON); - StateComposite.anchor(txtKeystoreFile).top(lblKeystoreFile, 5).left(0,15).right(btnBrowse,-5).set(); - StateComposite.anchor(btnBrowse).top(lblKeystoreFile, 5).right(100,-5).set(); + SWTUtils.setFontHeight(txtKeystoreFile, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(btnBrowse, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(txtKeystoreFile).top(lblKeystoreFile, 5).left(0,15).right(btnBrowse,-5).set(); + SWTUtils.anchor(btnBrowse).top(lblKeystoreFile, 5).right(100,-5).set(); this.lblKeystoreType = new Label(grpKeystore, SWT.NONE); - StateComposite.anchor(lblKeystoreType).top(txtKeystoreFile, 5).left(0,5).set(); - StateComposite.setFontHeight(lblKeystoreType, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(lblKeystoreType).top(txtKeystoreFile, 5).left(0,5).set(); + SWTUtils.setFontHeight(lblKeystoreType, Constants.TEXT_SIZE_NORMAL); this.btnLoad = new Button(this.grpKeystore, SWT.NONE); - StateComposite.anchor(btnLoad).top(lblKeystoreType, 5).right(100,-5).set(); - StateComposite.setFontHeight(btnLoad, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnLoad).top(lblKeystoreType, 5).right(100,-5).set(); + SWTUtils.setFontHeight(btnLoad, Constants.TEXT_SIZE_BUTTON); this.cmbKeystoreType = new Combo(grpKeystore, SWT.READ_ONLY); - StateComposite.anchor(cmbKeystoreType).top(lblKeystoreType, 5).left(0,15).right(btnLoad, -5).set(); - StateComposite.setFontHeight(cmbKeystoreType, Constants.TEXT_SIZE_NORMAL); - StateComposite.disableEventDefault(cmbKeystoreType, SWT.MouseVerticalWheel); + SWTUtils.anchor(cmbKeystoreType).top(lblKeystoreType, 5).left(0,15).right(btnLoad, -5).set(); + SWTUtils.setFontHeight(cmbKeystoreType, Constants.TEXT_SIZE_NORMAL); + SWTUtils.disableEventDefault(cmbKeystoreType, SWT.MouseVerticalWheel); this.lblKeystoreAlias = new Label(grpKeystore, SWT.NONE); - StateComposite.anchor(lblKeystoreAlias).top(cmbKeystoreType, 5).left(0, 5).set(); - StateComposite.setFontHeight(lblKeystoreAlias, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(lblKeystoreAlias).top(cmbKeystoreType, 5).left(0, 5).set(); + SWTUtils.setFontHeight(lblKeystoreAlias, Constants.TEXT_SIZE_NORMAL); this.cmbKeystoreAlias = new Combo(grpKeystore, SWT.NONE); - StateComposite.anchor(cmbKeystoreAlias).top(lblKeystoreAlias, 5).left(0,15).right(100,-5).set(); - StateComposite.setFontHeight(cmbKeystoreAlias, Constants.TEXT_SIZE_NORMAL); - StateComposite.disableEventDefault(cmbKeystoreAlias, SWT.MouseVerticalWheel); + SWTUtils.anchor(cmbKeystoreAlias).top(lblKeystoreAlias, 5).left(0,15).right(100,-5).set(); + SWTUtils.setFontHeight(cmbKeystoreAlias, Constants.TEXT_SIZE_NORMAL); + SWTUtils.disableEventDefault(cmbKeystoreAlias, SWT.MouseVerticalWheel); this.lblKeystorePassStoreType = new Label(this.grpKeystore, SWT.NONE); - StateComposite.anchor(lblKeystorePassStoreType).top(cmbKeystoreAlias, 5).left(0,5).set(); - StateComposite.setFontHeight(lblKeystorePassStoreType, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(lblKeystorePassStoreType).top(cmbKeystoreAlias, 5).left(0,5).set(); + SWTUtils.setFontHeight(lblKeystorePassStoreType, Constants.TEXT_SIZE_NORMAL); this.cmbKeystorePassStoreType = new Combo(grpKeystore, SWT.READ_ONLY); - StateComposite.anchor(cmbKeystorePassStoreType).top(lblKeystorePassStoreType, 5).left(0,15).right(100,-5).set(); - StateComposite.setFontHeight(cmbKeystorePassStoreType, Constants.TEXT_SIZE_NORMAL); - StateComposite.disableEventDefault(cmbKeystorePassStoreType, SWT.MouseVerticalWheel); + SWTUtils.anchor(cmbKeystorePassStoreType).top(lblKeystorePassStoreType, 5).left(0,15).right(100,-5).set(); + SWTUtils.setFontHeight(cmbKeystorePassStoreType, Constants.TEXT_SIZE_NORMAL); + SWTUtils.disableEventDefault(cmbKeystorePassStoreType, SWT.MouseVerticalWheel); this.lblKeystoreStorePass = new Label(grpKeystore, SWT.NONE); - StateComposite.anchor(lblKeystoreStorePass).top(cmbKeystorePassStoreType, 5).left(0,5).set(); - StateComposite.setFontHeight(lblKeystoreStorePass, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(lblKeystoreStorePass).top(cmbKeystorePassStoreType, 5).left(0,5).set(); + SWTUtils.setFontHeight(lblKeystoreStorePass, Constants.TEXT_SIZE_NORMAL); this.txtKeystoreStorePass = new Text(grpKeystore, SWT.BORDER | SWT.PASSWORD); - StateComposite.anchor(txtKeystoreStorePass).right(100, -5).top(lblKeystoreStorePass, 5).left(0,15).set(); - StateComposite.setFontHeight(txtKeystoreStorePass, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(txtKeystoreStorePass).right(100, -5).top(lblKeystoreStorePass, 5).left(0,15).set(); + SWTUtils.setFontHeight(txtKeystoreStorePass, Constants.TEXT_SIZE_NORMAL); this.lblKeystoreKeyPass = new Label(grpKeystore, SWT.NONE); - StateComposite.anchor(lblKeystoreKeyPass).top(txtKeystoreStorePass, 5).left(0,5).set(); - StateComposite.setFontHeight(lblKeystoreKeyPass, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(lblKeystoreKeyPass).top(txtKeystoreStorePass, 5).left(0,5).set(); + SWTUtils.setFontHeight(lblKeystoreKeyPass, Constants.TEXT_SIZE_NORMAL); this.txtKeystoreKeyPass = new Text(grpKeystore, SWT.BORDER | SWT.PASSWORD); - StateComposite.anchor(txtKeystoreKeyPass).top(lblKeystoreKeyPass, 5).left(0,15).right(100,-5).set(); - StateComposite.setFontHeight(txtKeystoreKeyPass, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(txtKeystoreKeyPass).top(lblKeystoreKeyPass, 5).left(0,15).right(100,-5).set(); + SWTUtils.setFontHeight(txtKeystoreKeyPass, Constants.TEXT_SIZE_NORMAL); this.txtKeystoreFile.addFocusListener(new FocusAdapter() { @Override diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java index 767f21d7..9aedf686 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java @@ -55,12 +55,12 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.commons.Constants; import at.asit.pdfover.commons.Messages; import at.asit.pdfover.commons.Profile; -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; import at.asit.pdfover.gui.exceptions.InvalidEmblemFile; import at.asit.pdfover.gui.utils.ImageConverter; +import at.asit.pdfover.gui.utils.SWTUtils; import at.asit.pdfover.gui.workflow.config.ConfigurationManager; import at.asit.pdfover.gui.workflow.config.ConfigurationDataInMemory; import at.asit.pdfover.gui.workflow.states.State; @@ -116,25 +116,25 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { setLayout(new FormLayout()); this.grpHandySignatur = new Group(this, SWT.NONE | SWT.RESIZE); - StateComposite.anchor(grpHandySignatur).right(100,-5).left(0,5).top(0,5).set(); + SWTUtils.anchor(grpHandySignatur).right(100,-5).left(0,5).top(0,5).set(); grpHandySignatur.setLayout(new GridLayout(2, false)); - StateComposite.setFontHeight(grpHandySignatur, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(grpHandySignatur, Constants.TEXT_SIZE_NORMAL); this.lblMobileNumber = new Label(grpHandySignatur, SWT.NONE | SWT.RESIZE); this.lblMobileNumber.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); - StateComposite.setFontHeight(lblMobileNumber, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(lblMobileNumber, Constants.TEXT_SIZE_NORMAL); Composite compMobileNumerContainer = new Composite(this.grpHandySignatur, SWT.NONE); compMobileNumerContainer.setLayout(new FormLayout()); compMobileNumerContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1)); this.txtMobileNumber = new Text(compMobileNumerContainer, SWT.BORDER | SWT.RESIZE); - StateComposite.anchor(txtMobileNumber).left(0,5).right(100,-42).top(0).set(); - StateComposite.setFontHeight(txtMobileNumber, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(txtMobileNumber).left(0,5).right(100,-42).top(0).set(); + SWTUtils.setFontHeight(txtMobileNumber, Constants.TEXT_SIZE_NORMAL); this.txtMobileNumberErrorMarker = new ErrorMarker(compMobileNumerContainer, SWT.NONE, ""); this.txtMobileNumberErrorMarker.setVisible(false); - StateComposite.anchor(txtMobileNumberErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set(); + SWTUtils.anchor(txtMobileNumberErrorMarker).left(100,-32).right(100).top(0).bottom(0,32).set(); this.txtMobileNumber.addTraverseListener(e -> { if (e.detail == SWT.TRAVERSE_RETURN) { @@ -150,14 +150,14 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { }); this.grpSignatureProfile = new Group(this, SWT.NONE); - StateComposite.anchor(grpSignatureProfile).right(100,-5).left(0,5).top(grpHandySignatur, 5).set(); + SWTUtils.anchor(grpSignatureProfile).right(100,-5).left(0,5).top(grpHandySignatur, 5).set(); this.grpSignatureProfile.setLayout(new FormLayout()); - StateComposite.setFontHeight(grpSignatureProfile, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(grpSignatureProfile, Constants.TEXT_SIZE_NORMAL); this.cmbSignatureProfiles = new Combo(this.grpSignatureProfile, SWT.READ_ONLY); - StateComposite.anchor(cmbSignatureProfiles).left(0,10).right(100,-10).top(0,10).bottom(100,-10).set(); - StateComposite.setFontHeight(cmbSignatureProfiles, Constants.TEXT_SIZE_NORMAL); - StateComposite.disableEventDefault(cmbSignatureProfiles, SWT.MouseVerticalWheel); + SWTUtils.anchor(cmbSignatureProfiles).left(0,10).right(100,-10).top(0,10).bottom(100,-10).set(); + SWTUtils.setFontHeight(cmbSignatureProfiles, Constants.TEXT_SIZE_NORMAL); + SWTUtils.disableEventDefault(cmbSignatureProfiles, SWT.MouseVerticalWheel); this.cmbSignatureProfiles.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -171,14 +171,14 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { }); this.grpSignatureLang = new Group(this, SWT.NONE); - StateComposite.anchor(grpSignatureLang).right(100,-5).top(grpSignatureProfile, 5).left(0,5).set(); + SWTUtils.anchor(grpSignatureLang).right(100,-5).top(grpSignatureProfile, 5).left(0,5).set(); this.grpSignatureLang.setLayout(new FormLayout()); - StateComposite.setFontHeight(grpSignatureLang, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(grpSignatureLang, Constants.TEXT_SIZE_NORMAL); this.cmbSignatureLang = new Combo(this.grpSignatureLang, SWT.READ_ONLY); - StateComposite.anchor(cmbSignatureLang).left(0,10).right(100,-10).top(0,10).bottom(100,-10).set(); - StateComposite.setFontHeight(cmbSignatureLang, Constants.TEXT_SIZE_NORMAL); - StateComposite.disableEventDefault(cmbSignatureLang, SWT.MouseVerticalWheel); + SWTUtils.anchor(cmbSignatureLang).left(0,10).right(100,-10).top(0,10).bottom(100,-10).set(); + SWTUtils.setFontHeight(cmbSignatureLang, Constants.TEXT_SIZE_NORMAL); + SWTUtils.disableEventDefault(cmbSignatureLang, SWT.MouseVerticalWheel); this.cmbSignatureLang.setItems(Arrays.stream(Constants.SUPPORTED_LOCALES).map(l -> l.getDisplayLanguage()).toArray(String[]::new)); this.cmbSignatureLang.addSelectionListener(new SelectionAdapter() { @@ -193,9 +193,9 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { }); this.grpSignatureNote = new Group(this, SWT.NONE); - StateComposite.anchor(grpSignatureNote).right(100,-5).top(grpSignatureLang,5).left(0,5).set(); + SWTUtils.anchor(grpSignatureNote).right(100,-5).top(grpSignatureLang,5).left(0,5).set(); this.grpSignatureNote.setLayout(new GridLayout(2, false)); - StateComposite.setFontHeight(grpSignatureNote, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(grpSignatureNote, Constants.TEXT_SIZE_NORMAL); this.lblSignatureNote = new Label(this.grpSignatureNote, SWT.NONE); do { /* grid positioning */ @@ -205,15 +205,15 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { this.lblSignatureNote.setLayoutData(gd_lblSignatureNote); this.lblSignatureNote.setBounds(0, 0, 57, 15); } while (false); - StateComposite.setFontHeight(lblSignatureNote, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(lblSignatureNote, Constants.TEXT_SIZE_NORMAL); Composite compSignatureNoteContainer = new Composite(this.grpSignatureNote, SWT.NONE); compSignatureNoteContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1)); compSignatureNoteContainer.setLayout(new FormLayout()); this.txtSignatureNote = new Text(compSignatureNoteContainer, SWT.BORDER); - StateComposite.anchor(txtSignatureNote).top(0,0).left(0,5).right(100,-42).set(); - StateComposite.setFontHeight(txtSignatureNote, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(txtSignatureNote).top(0,0).left(0,5).right(100,-42).set(); + SWTUtils.setFontHeight(txtSignatureNote, Constants.TEXT_SIZE_NORMAL); this.txtSignatureNote.addFocusListener(new FocusAdapter() { @Override @@ -233,8 +233,8 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { compSignatureNoteButtonContainer.setLayout(new FormLayout()); this.btnSignatureNoteDefault = new Button(compSignatureNoteButtonContainer, SWT.NONE); - StateComposite.anchor(btnSignatureNoteDefault).top(0,0).right(100,-42).set(); - StateComposite.setFontHeight(btnSignatureNoteDefault, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnSignatureNoteDefault).top(0,0).right(100,-42).set(); + SWTUtils.setFontHeight(btnSignatureNoteDefault, Constants.TEXT_SIZE_BUTTON); this.btnSignatureNoteDefault.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -243,26 +243,26 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { }); this.grpPreview = new Group(this, SWT.NONE); - StateComposite.anchor(grpPreview).left(0,5).right(100,-5).top(grpSignatureNote, 5).height(250).set(); + SWTUtils.anchor(grpPreview).left(0,5).right(100,-5).top(grpSignatureNote, 5).height(250).set(); this.grpPreview.setLayout(new FormLayout()); - StateComposite.setFontHeight(grpPreview, Constants.TEXT_SIZE_NORMAL); + SWTUtils.setFontHeight(grpPreview, Constants.TEXT_SIZE_NORMAL); Composite containerComposite = new Composite(this.grpPreview, SWT.NONE); - StateComposite.anchor(containerComposite).left(0).right(100).top(0).bottom(100).set(); + SWTUtils.anchor(containerComposite).left(0).right(100).top(0).bottom(100).set(); containerComposite.setLayout(new FormLayout()); this.btnBrowseLogo = new Button(containerComposite, SWT.NONE); - StateComposite.anchor(btnBrowseLogo).top(0,5).right(50,-5).set(); - StateComposite.setFontHeight(btnBrowseLogo, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnBrowseLogo).top(0,5).right(50,-5).set(); + SWTUtils.setFontHeight(btnBrowseLogo, Constants.TEXT_SIZE_BUTTON); this.btnClearImage = new Button(containerComposite, SWT.NATIVE); - StateComposite.anchor(btnClearImage).top(0,5).left(50, 5).set(); - StateComposite.setFontHeight(btnClearImage, Constants.TEXT_SIZE_BUTTON); + SWTUtils.anchor(btnClearImage).top(0,5).left(50, 5).set(); + SWTUtils.setFontHeight(btnClearImage, Constants.TEXT_SIZE_BUTTON); this.btnClearImage.setVisible(false); this.cSigPreview = new Canvas(containerComposite, SWT.RESIZE); - StateComposite.anchor(cSigPreview).left(0, 5).right(100,-5).top(btnBrowseLogo,5).bottom(100,-5).set(); - StateComposite.setFontHeight(cSigPreview, Constants.TEXT_SIZE_NORMAL); + SWTUtils.anchor(cSigPreview).left(0, 5).right(100,-5).top(btnBrowseLogo,5).bottom(100,-5).set(); + SWTUtils.setFontHeight(cSigPreview, Constants.TEXT_SIZE_NORMAL); this.cSigPreview.addPaintListener(e -> SimpleConfigurationComposite.this.paintSignaturePreview(e)); DropTarget dnd_target = new DropTarget(containerComposite, DND.DROP_DEFAULT | DND.DROP_COPY); -- cgit v1.2.3