summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2021-07-26 15:57:49 +0200
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2021-07-26 15:57:49 +0200
commita6f6f443c7e8548171c434766f40c0248ff9a141 (patch)
treef1b751ab10d8e708ee4777098cb1fb4cc86e6d1e /pdf-over-gui/src/main/java
parent5946a3dd1fdbc85bf738b6854383d2b4ea97da7e (diff)
downloadpdf-over-a6f6f443c7e8548171c434766f40c0248ff9a141.tar.gz
pdf-over-a6f6f443c7e8548171c434766f40c0248ff9a141.tar.bz2
pdf-over-a6f6f443c7e8548171c434766f40c0248ff9a141.zip
added text for data protection information
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java64
1 files changed, 56 insertions, 8 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
index 0940ea67..b4626d0c 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
@@ -32,13 +32,7 @@ import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.program.Program;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.swt.widgets.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -297,6 +291,8 @@ public class ConfigurationComposite extends StateComposite {
private class AboutComposite extends StateComposite {
private Link lnkAbout;
+ private Link lnkDataProtection;
+ private Label lblDataProtection;
/**
* @param parent
* @param style
@@ -306,7 +302,7 @@ public class ConfigurationComposite extends StateComposite {
setLayout(new FormLayout());
- this.lnkAbout = new Link(this, SWT.WRAP);
+ this.lnkAbout = new Link(this, SWT.NONE);
FormData fd_lnkAbout = new FormData();
fd_lnkAbout.right = new FormAttachment(100, -5);
@@ -340,10 +336,60 @@ public class ConfigurationComposite extends StateComposite {
}
});
+ this.lblDataProtection = new Label(this, SWT.NONE);
+ FormData fd_lblDataProtection = new FormData();
+ fd_lblDataProtection.top = new FormAttachment(this.lnkAbout, 15);
+ fd_lblDataProtection.right = new FormAttachment(100, -5);
+ fd_lblDataProtection.left = new FormAttachment(0, 5);
+ fd_lblDataProtection.width = 100;
+ this.lblDataProtection.setLayoutData(fd_lblDataProtection);
+
+ FontData[] fD_lblDataProtection = this.lblDataProtection.getFont().getFontData();
+ fD_lblDataProtection[0].setHeight(Constants.TEXT_SIZE_BIG);
+ this.lblDataProtection.setFont(new Font(Display.getCurrent(),
+ fD_lblDataProtection[0]));
+
+ this.lnkDataProtection = new Link(this, SWT.NONE);
+
+ FormData fd_lnkDataProtection = new FormData();
+ fd_lnkDataProtection.right = new FormAttachment(100, -5);
+ fd_lnkDataProtection.left = new FormAttachment(0, 5);
+ fd_lnkDataProtection.top = new FormAttachment(this.lblDataProtection, 10);
+ fd_lnkDataProtection.width = 100;
+ fd_lnkDataProtection.height = 120;
+ this.lnkDataProtection.setLayoutData(fd_lnkDataProtection);
+
+ FontData[] fD_lnkDataProtection = this.lnkDataProtection.getFont().getFontData();
+ fD_lnkDataProtection[0].setHeight(Constants.TEXT_SIZE_NORMAL);
+ this.lnkDataProtection.setFont(new Font(Display.getCurrent(),
+ fD_lnkDataProtection[0]));
+
+
+ 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$
+ if (Desktop.isDesktopSupported()) {
+ Desktop.getDesktop().browse(url);
+ } else {
+ log.info("AWT Desktop is not supported on this platform"); //$NON-NLS-1$
+ Program.launch(url.toString());
+ }
+ } catch (IOException ex) {
+ log.error("AboutComposite: ", ex); //$NON-NLS-1$
+ } catch (URISyntaxException ex) {
+ log.error("AboutComposite: ", ex); //$NON-NLS-1$
+ }
+ }
+ });
+
// Load localized strings
reloadResources();
}
+
/* (non-Javadoc)
* @see at.asit.pdfover.gui.composites.StateComposite#doLayout()
*/
@@ -358,6 +404,8 @@ public class ConfigurationComposite extends StateComposite {
@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"));
}
}