From 90d8e513e43b29dbc7fbe67a89c0e2d8b4ff17ed Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Wed, 22 Jun 2022 15:46:13 +0200 Subject: clean-up refactor for AboutComposite --- .../composites/configuration/AboutComposite.java | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) 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 d32d77d0..7bd64ab4 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 @@ -36,55 +36,55 @@ public class AboutComposite extends ConfigurationCompositeBase { setLayout(new FormLayout()); - this.lnkAbout = new Link(this, SWT.NONE); - StateComposite.anchor(lnkAbout).right(100,-5).left(0,5).top(0,5).width(100).set(); + 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); + 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); + + 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); + this.lnkAbout.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { try { - URI url = new URI(Messages.getString("config.LicenseURL")); //$NON-NLS-1$ - log.debug("Trying to open " + url.toString()); //$NON-NLS-1$ + URI url = new URI(Messages.getString("config.LicenseURL")); + log.debug("Trying to open " + url.toString()); if (Desktop.isDesktopSupported()) { Desktop.getDesktop().browse(url); } else { - log.info("AWT Desktop is not supported on this platform"); //$NON-NLS-1$ + log.info("AWT Desktop is not supported on this platform"); Program.launch(url.toString()); } } catch (IOException ex) { - log.error("AboutComposite: ", ex); //$NON-NLS-1$ + log.error("AboutComposite: ", ex); } catch (URISyntaxException ex) { - log.error("AboutComposite: ", ex); //$NON-NLS-1$ + log.error("AboutComposite: ", ex); } } }); - this.lblDataProtection = new Label(this, SWT.NONE); - StateComposite.anchor(lblDataProtection).top(lnkAbout, 15).right(100,-5).left(0,5).width(100).set(); - StateComposite.setFontHeight(lblDataProtection, Constants.TEXT_SIZE_BIG); - StateComposite.setFontStyle(lblDataProtection, SWT.BOLD); - - this.lnkDataProtection = new Link(this, SWT.NONE); - StateComposite.anchor(lnkDataProtection).right(100,-5).left(0,5).top(lblDataProtection,10).bottom(100,-5).width(100).height(120).set(); - StateComposite.setFontHeight(lnkDataProtection, Constants.TEXT_SIZE_NORMAL); - this.lnkDataProtection.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { try { - URI url = new URI(Messages.getString("config.DataProtectionURL")); //$NON-NLS-1$ - log.debug("Trying to open " + url.toString()); //$NON-NLS-1$ + URI url = new URI(Messages.getString("config.DataProtectionURL")); + log.debug("Trying to open " + url.toString()); if (Desktop.isDesktopSupported()) { Desktop.getDesktop().browse(url); } else { - log.info("AWT Desktop is not supported on this platform"); //$NON-NLS-1$ + log.info("AWT Desktop is not supported on this platform"); Program.launch(url.toString()); } } catch (IOException ex) { - log.error("AboutComposite: ", ex); //$NON-NLS-1$ + log.error("AboutComposite: ", ex); } catch (URISyntaxException ex) { - log.error("AboutComposite: ", ex); //$NON-NLS-1$ + log.error("AboutComposite: ", ex); } } }); @@ -108,8 +108,8 @@ public class AboutComposite extends ConfigurationCompositeBase { @Override public void reloadResources() { this.lnkAbout.setText(Messages.getString("config.AboutText")); //$NON-NLS-1$ - this.lnkDataProtection.setText(Messages.getString("config.DataProtectionStatement")); this.lblDataProtection.setText(Messages.getString("config.DataProtection")); + this.lnkDataProtection.setText(Messages.getString("config.DataProtectionStatement")); } -- cgit v1.2.3