diff options
author | Michael Forstner <michael.forstner@bsi-in.de> | 2018-12-10 13:03:52 +0100 |
---|---|---|
committer | Sun Zhe <31067185+ZheSun88@users.noreply.github.com> | 2018-12-10 14:03:52 +0200 |
commit | 5480d82bb8554d3980a55714c6128cfe1d63ec92 (patch) | |
tree | b2f9c2f05b1044d7e801d71387ed24004b237bc8 /documentation | |
parent | e7b721f3e81534957b27a3af656021a643530cdd (diff) | |
download | vaadin-framework-5480d82bb8554d3980a55714c6128cfe1d63ec92.tar.gz vaadin-framework-5480d82bb8554d3980a55714c6128cfe1d63ec92.zip |
Add missing FocusShortcutListener (#11289)
* Add missing FocusShortcutListener
Was removed from 8.0 and not readded.
Fixes #8297
* Update Release note for this change
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/advanced/advanced-shortcuts.asciidoc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/documentation/advanced/advanced-shortcuts.asciidoc b/documentation/advanced/advanced-shortcuts.asciidoc index c1fffe4617..3f3f6c12c1 100644 --- a/documentation/advanced/advanced-shortcuts.asciidoc +++ b/documentation/advanced/advanced-shortcuts.asciidoc @@ -50,11 +50,10 @@ image::img/shortcut-defaultbutton.png[] [[advanced.shortcuts.focus]] == Field Focus Shortcuts -You can define a shortcut key that sets the focus to a field component (any -component that inherits [classname]#AbstractField#) by adding a -[classname]#FocusShortcut# as a shortcut listener to the field. +You can define a shortcut key that sets the focus to any focusable component (implements [interface]#Focusable#), usually field components, by adding a +[interface]#FocusShortcut# as a shortcut listener to the component. -The constructor of the [classname]#FocusShortcut# takes the field component as +The constructor of the [classname]#FocusShortcut# takes the focusable component as its first parameter, followed by the key code, and an optional list of modifier keys, as listed in <<advanced.shortcuts.keycodes>>. @@ -64,7 +63,7 @@ keys, as listed in <<advanced.shortcuts.keycodes>>. // A field with Alt+N bound to it TextField name = new TextField("Name (Alt+N)"); name.addShortcutListener( - new AbstractField.FocusShortcut(name, KeyCode.N, + new FocusShortcut(name, KeyCode.N, ModifierKey.ALT)); layout.addComponent(name); ---- @@ -78,7 +77,7 @@ key is indicated with an ampersand ( [literal]#++&++#). // A field with Alt+A bound to it, using shorthand notation TextField address = new TextField("Address (Alt+A)"); address.addShortcutListener( - new AbstractField.FocusShortcut(address, "&Address")); + new FocusShortcut(address, "&Address")); ---- This is especially useful for internationalization, so that you can determine @@ -269,7 +268,7 @@ following defines a kbd:[Ctrl+Shift+N] key combination for a shortcut. ---- TextField name = new TextField("Name (Ctrl+Shift+N)"); name.addShortcutListener( - new AbstractField.FocusShortcut(name, KeyCode.N, + new FocusShortcut(name, KeyCode.N, ModifierKey.CTRL, ModifierKey.SHIFT)); ---- |