diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-11-03 14:15:48 +0100 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-11-03 14:15:48 +0100 |
commit | c5c829fea00057499f6818d450f849ac255c2f10 (patch) | |
tree | 3d3e0831cb01f59206203490bf8e9b6d2ef55505 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku | |
parent | 612e0044b3a2529c85e3f2b0224f43c7590b5898 (diff) | |
download | pdf-over-c5c829fea00057499f6818d450f849ac255c2f10.tar.gz pdf-over-c5c829fea00057499f6818d450f849ac255c2f10.tar.bz2 pdf-over-c5c829fea00057499f6818d450f849ac255c2f10.zip |
auto focus username/password field as appropriate
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku')
2 files changed, 9 insertions, 1 deletions
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); |