summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java5
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUEnterNumberComposite.java9
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java1
3 files changed, 14 insertions, 1 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java
index 833669ff..2a340fa8 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java
@@ -52,4 +52,9 @@ public abstract class StateComposite extends Composite {
* Reloads the localizeable resources
*/
public abstract void reloadResources();
+
+ /**
+ * Called when the control is .display()ed
+ */
+ public void onDisplay() {}
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUEnterNumberComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUEnterNumberComposite.java
index b7d70167..38335c83 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUEnterNumberComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUEnterNumberComposite.java
@@ -206,6 +206,14 @@ public class MobileBKUEnterNumberComposite extends StateComposite {
SWTUtils.anchor(btn_remember).right(100, -10).top(0, 5);
}
+ @Override public void onDisplay() {
+ if (this.txt_number.getText().isEmpty()) {
+ this.txt_number.setFocus();
+ } else {
+ this.txt_password.setFocus();
+ }
+ }
+
@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
@@ -244,7 +252,6 @@ public class MobileBKUEnterNumberComposite extends StateComposite {
if (this.mobileNumber != null && !this.mobileNumber.isEmpty()) {
this.txt_number.setText(this.mobileNumber);
- this.txt_password.setFocus();
} else {
this.txt_number.setText("");
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java
index 70439527..89dc431d 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java
@@ -66,6 +66,7 @@ public class MobileBKUFido2Composite extends StateComposite {
}
}).start();
}
+ @Override public void onDisplay() { beginAuthentication(); }
public MobileBKUFido2Composite(Composite parent, int style, State state) {
super(parent, style, state);