diff options
author | Andreas Abraham <andreas.abraham@egiz.gv.at> | 2019-07-31 17:31:31 +0200 |
---|---|---|
committer | Andreas Abraham <andreas.abraham@egiz.gv.at> | 2019-07-31 17:31:31 +0200 |
commit | 562b38f66da0dbe67f8cff9c02165ca89434d171 (patch) | |
tree | 691ab5b0dafbd1e90fc75a839f6a1e1a52929519 /pdf-over-gui/src/main/java | |
parent | 2f20884b7899d2c044646273f226cb9071408e54 (diff) | |
download | pdf-over-562b38f66da0dbe67f8cff9c02165ca89434d171.tar.gz pdf-over-562b38f66da0dbe67f8cff9c02165ca89434d171.tar.bz2 pdf-over-562b38f66da0dbe67f8cff9c02165ca89434d171.zip |
button implemented where the user can request tan sms during loading spinner wait
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingForAppComposite.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingForAppComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingForAppComposite.java index 039ddc41..80bfe46c 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingForAppComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/WaitingForAppComposite.java @@ -15,14 +15,18 @@ */
package at.asit.pdfover.gui.composites;
+
// Imports
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.ProgressBar;
+import org.eclipse.swt.widgets.Button;
import at.asit.pdfover.gui.utils.Messages;
import at.asit.pdfover.gui.workflow.states.State;
@@ -32,6 +36,37 @@ import at.asit.pdfover.gui.workflow.states.State; */
public class WaitingForAppComposite extends StateComposite {
private Label lbl_description;
+ private Button btnRequestSms;
+ private boolean userSms;
+
+ /**
+ *
+ */
+ private final class SMSSelectionListener extends SelectionAdapter {
+ /**
+ * Empty constructor
+ */
+ public SMSSelectionListener() {
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if(!WaitingForAppComposite.this.btnRequestSms.getEnabled()) {
+ return;
+ }
+
+ WaitingForAppComposite.this.setUserSMS(true);
+ WaitingForAppComposite.this.btnRequestSms.setEnabled(false);
+ }
+ }
+
+ public void setUserSMS(boolean bool ) {
+ this.userSms = bool;
+ }
+
+ public boolean getUserSMS() {
+ return this.userSms;
+ }
/**
* Create the composite.
@@ -59,6 +94,17 @@ public class WaitingForAppComposite extends StateComposite { fd_progressBar.left = new FormAttachment(50, -100);
fd_progressBar.right = new FormAttachment(50, +100);
progressBar.setLayoutData(fd_progressBar);
+
+
+ this.btnRequestSms = new Button(this, SWT.NONE);
+ FormData fd_btnRequestSms = new FormData();
+ fd_btnRequestSms.top = new FormAttachment(progressBar, 23);
+ fd_btnRequestSms.right = new FormAttachment(100, -123);
+ this.btnRequestSms.setLayoutData(fd_btnRequestSms);
+ this.btnRequestSms.setText(Messages.getString("WaitingForAppComposite.btnRequestSms.text")); //$NON-NLS-1$
+ this.btnRequestSms.addSelectionListener(new SMSSelectionListener());
+ reloadResources();
+
}
@Override
@@ -80,5 +126,6 @@ public class WaitingForAppComposite extends StateComposite { @Override
public void reloadResources() {
this.lbl_description.setText(Messages.getString("waiting_for_app.message")); //$NON-NLS-1$
+ this.btnRequestSms.setText(Messages.getString("tanEnter.SMS")); //$NON-NLS-1$
}
}
|