lz.FocusService
Handles keyboard focus.
JavaScript: lz.FocusService
lz.Focus
is the single instance of the class
lz.FocusService
.
This service manages the keyboard focus. At any time, at most one view
has the keyboard focus. This is the view that receives key events
when a key is pressed.
See The Software Developer's Guide for a discussion of keyboard focus.
Note that the view.getNextSelection() and view.getPrevSelection() methods can be overridden to change the tab order
Methods
-
-
lz.FocusService.clearFocus();
Remove the focus from the currently focused view (if there is one).
An 'onblur' event is first sent to the view.
-
-
lz.FocusService.getFocus();
Get the currently focused view.
-
-
lz.FocusService.getNext(focusview : lz.view);
Returns the next focusable view.
-
-
lz.FocusService.getPrev(focusview : lz.view);
Returns the previous focusable view.
-
-
Move the focus to the next focusable view.
-
-
Move the focus to the previous focusable view.
-
-
lz.FocusService.setFocus(newsel : lz.view, fwkey);
Set the focus to the given view. If this is not the currently
focused view, an onblur event is sent to the currently focused view,
and an onfocus event is sent to the new view. When setFocus is called as the
result of an onblur or onfocus event, all the delegates registered for the
event run before the next setFocus call is made. While it is not an error
for multiple responders to call setFocus as the result of the same onfocus
or onblur event, only one of the calls will be executed.
The state of the view may be unknown during the blur/focus process. When
a view loses focus, its blurring variable is set to true during the
process.