com.extjs.gxt.ui.client.aria
Class FocusManager

java.lang.Object
  extended by com.extjs.gxt.ui.client.aria.FocusManager

public class FocusManager
extends java.lang.Object

The FocusManager is used to control keyboard navigation among and within components.


Field Summary
static EventType TabNext
          The TabNext event type.
static EventType TabPrevious
          The TabPrevious event type.
 
Method Summary
 void disable()
          Disables the focus manager.
 void enable()
          Enables the focus manager.
 NavigationHandler findNavigationHandler(Component comp)
          Returns the first matching navigation handler given the target component.
static FocusManager get()
          Returns the singleton instance.
protected  void initHandlers()
           
 boolean isInsertExitFocusElement()
           
 boolean isManaged()
          Returns true if focus manager is managed.
protected  void onToggle(Component c, PreviewEvent pe)
           
 void register(FocusHandler handler)
          Registers a focus handler.
 void register(NavigationHandler handler)
          Registers a navigation handler.
 void setInsertExitFocusElement(boolean insertExitFocusElement)
          True to insert a dummy element to allow the user to tab out of the application (defaults to true).
 void setManaged(boolean managed)
          True to let focus manager control navigation keys, false to use natural tab indexes (defaults to true).
 void unregister(FocusHandler handler)
          Unregisters a focus handler.
 void unregister(NavigationHandler handler)
          Unregisters a navigation handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TabNext

public static final EventType TabNext
The TabNext event type.


TabPrevious

public static final EventType TabPrevious
The TabPrevious event type.

Method Detail

get

public static FocusManager get()
Returns the singleton instance.

Returns:
the focus manager instance

disable

public void disable()
Disables the focus manager.


enable

public void enable()
Enables the focus manager.


findNavigationHandler

public NavigationHandler findNavigationHandler(Component comp)
Returns the first matching navigation handler given the target component.

Parameters:
comp - the target component
Returns:
the handler or null if no matches

isInsertExitFocusElement

public boolean isInsertExitFocusElement()

isManaged

public boolean isManaged()
Returns true if focus manager is managed.

Returns:
true if managed

register

public void register(FocusHandler handler)
Registers a focus handler.

Parameters:
handler - the handler

register

public void register(NavigationHandler handler)
Registers a navigation handler.

Parameters:
handler - the handler

setInsertExitFocusElement

public void setInsertExitFocusElement(boolean insertExitFocusElement)
True to insert a dummy element to allow the user to tab out of the application (defaults to true).

Parameters:
insertExitFocusElement - true to insert exit element

setManaged

public void setManaged(boolean managed)
True to let focus manager control navigation keys, false to use natural tab indexes (defaults to true).

Parameters:
managed - true if managed

unregister

public void unregister(FocusHandler handler)
Unregisters a focus handler.

Parameters:
handler - the focus handler

unregister

public void unregister(NavigationHandler handler)
Unregisters a navigation handler.

Parameters:
handler - the navigation handler

initHandlers

protected void initHandlers()

onToggle

protected void onToggle(Component c,
                        PreviewEvent pe)