OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

oracle.adfinternal.view.js.laf.dhtml.rich
Class AdfFocusUtils

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adfinternal.view.js.laf.dhtml.rich.AdfFocusUtils

public class AdfFocusUtils
extends Object



Field Summary


Fields inherited from org.ecmascript.object.Object

constructor, prototype


Constructor Summary

public
AdfFocusUtils()


Method Summary

public static Object
containsFocus(Object element)
Tests whether the specified element contains the keyboard focus.
public static Object
focusElement(HTMLElement element)
Sets focus to element
public static Object
focusElementDelayed(Object element, Object timeout)
Focuses the element after a timeout.
private static Object
_focusElementDelayedCallback(Object element)
private static Object
_focusElementImpl(Object element)
public static HTMLElement
focusFirstTabStop(HTMLElement element)
sets focus to the first focusable element inside element this can also be the element itself
public static HTMLElement
focusLastTabStop(HTMLElement element)
sets focus to the last focusable element inside element this can also be the element itself
public static HTMLElement
focusNextTabStop(HTMLElement element, Object contextElement, Object startOutside)
sets focus to the next focusable element after element inside contextElement if no contextElement is given the ownerdocument of element will be the context when element is the last focusable element inside the context the first focusable element inside the context will be focused When optional parameter startOutside is true the next tabstop won't be in element
public static HTMLElement
focusPreviousTabStop(HTMLElement element, Object contextElement, Object startOutside)
sets focus to the previous focusable element before element inside contextElement if no contextElement is given the ownerdocument of element will be the context when element is the first focusable element inside the context the last focusable element inside the context will be focused When optional parameter startOutside is true the next tabstop won't be in element
public static Object
getFirstTabStop(HTMLElement element, Boolean isExclusive)
returns the first focusable element inside element when optional parameter isExclusive equals true this method will not return element itself
public static Object
getLastTabStop(HTMLElement element, Boolean isExclusive)
returns the last focusable element inside element when optional parameter isExclusive equals true this method will not return element itself
public static Object
getNextTabStop(Object element, Object contextElement, Object startOutside)
returns the next focusable element after element inside contextElement if no contextElement is given the ownerdocument of element will be the context when element is the last focusable element inside the context the method will return undefined when optional parameter startOutside is true the next tabstop won't be in element
public static Object
getPreviousTabStop(Object element, Object contextElement)
returns the previous focusable element before element inside contextElement if no contextElement is given the ownerdocument of element will be the context when element is the first focusable element inside the context the method will return undefined
public static Object
isConnectedAndVisible(Object el)
Tests whether the element and its ancestors are connected to the document and visible.
public static Object
isFocusable(Object el, Object context)
isFocusable determines whether the HTML element el is focusable.
public static Boolean
isFocusChangePending()
Tests whether a focus change is pending.
public static Object
isTabStop(Object el)
isTabStop determines whether the HTML element el is a tab-stop in the current state of the page.


Field Detail


Constructor Detail


AdfFocusUtils

public AdfFocusUtils()

Method Detail


containsFocus

public static Object containsFocus(Object element)

Tests whether the specified element contains the keyboard focus.

Parameters:
element    
Return:
Object

focusElement

public static Object focusElement(HTMLElement element)

Sets focus to element

Parameters:
element  -  the DOM element to focus.
Return:
Object

focusElementDelayed

public static Object focusElementDelayed(Object element,
                                         Object timeout)

Focuses the element after a timeout. Most callers should simply call AdfFocusUtils.focusElement(). In certain rare cases, for example, in order to work around obscure focus-related browser bugs, it may be necessary to offload the focus() call to a timeout. Such cases should be extremely unusual. One other case where delayed focus is useful is screen reader mode. In screen reader mode, delaying the focus() call can give the screen reader a chance to catch up with content changes that have occurred, for example due to popup launch/dismissal and scoping/unscoping. If we do not delay in these cases, JAWS gets very confused. For example, JAWS may not announce focus changes - ie. may not announce the newly focused element in a popup. JAWS also gets confused after popup dismissal and thinks that it is still focused on content in the popup. Sadly, the only way that we have found to work around this problem is to delay the focus change, and even more sadly, the results are still inconsistent. Note that AdfFocusUtils.focusElement() automatically calls focusElementDelayed() as needed for the screen reader mode case. So, most code should simply call focusElement().

Parameters:
element    
timeout    
Return:
Object

_focusElementDelayedCallback

private static Object _focusElementDelayedCallback(Object element)

Parameters:
element    
Return:
Object

_focusElementImpl

private static Object _focusElementImpl(Object element)

Parameters:
element    
Return:
Object

focusFirstTabStop

public static HTMLElement focusFirstTabStop(HTMLElement element)

sets focus to the first focusable element inside element this can also be the element itself

Parameters:
element  -  DOM element to attempt to start to attempt focusing from
Return:
HTMLElement - The DOM element actually focused on, if any

focusLastTabStop

public static HTMLElement focusLastTabStop(HTMLElement element)

sets focus to the last focusable element inside element this can also be the element itself

Parameters:
element  -  DOM element of subtree to attempt to focus on the last focusable element of.
Return:
HTMLElement - The DOM element actually focused on, if any

focusNextTabStop

public static HTMLElement focusNextTabStop(HTMLElement element,
                                           Object contextElement,
                                           Object startOutside)

sets focus to the next focusable element after element inside contextElement if no contextElement is given the ownerdocument of element will be the context when element is the last focusable element inside the context the first focusable element inside the context will be focused When optional parameter startOutside is true the next tabstop won't be in element

Parameters:
element  -  DOM element to attempt to start to attempt focusing on the next element of
contextElement    
startOutside    
Return:
HTMLElement - The DOM element actually focused on, if any

focusPreviousTabStop

public static HTMLElement focusPreviousTabStop(HTMLElement element,
                                               Object contextElement,
                                               Object startOutside)

sets focus to the previous focusable element before element inside contextElement if no contextElement is given the ownerdocument of element will be the context when element is the first focusable element inside the context the last focusable element inside the context will be focused When optional parameter startOutside is true the next tabstop won't be in element

Parameters:
element  -  DOM element of subtree to attempt to focus on the previous focusable element of.
contextElement    
startOutside    
Return:
HTMLElement - The DOM element actually focused on, if any

getFirstTabStop

public static Object getFirstTabStop(HTMLElement element,
                                     Boolean isExclusive)

returns the first focusable element inside element when optional parameter isExclusive equals true this method will not return element itself

Parameters:
element  -  element to begin searching for tabstops from
isExclusive  -  Whether to include element in the allowed tab stops
Default value = false
Return:
Object

getLastTabStop

public static Object getLastTabStop(HTMLElement element,
                                    Boolean isExclusive)

returns the last focusable element inside element when optional parameter isExclusive equals true this method will not return element itself

Parameters:
element  -  element to begin searching for last tabstops from
isExclusive  -  Whether to include element in the allowed tab stops
Default value = false
Return:
Object

getNextTabStop

public static Object getNextTabStop(Object element,
                                    Object contextElement,
                                    Object startOutside)

returns the next focusable element after element inside contextElement if no contextElement is given the ownerdocument of element will be the context when element is the last focusable element inside the context the method will return undefined when optional parameter startOutside is true the next tabstop won't be in element

Parameters:
element    
contextElement    
startOutside    
Return:
Object

getPreviousTabStop

public static Object getPreviousTabStop(Object element,
                                        Object contextElement)

returns the previous focusable element before element inside contextElement if no contextElement is given the ownerdocument of element will be the context when element is the first focusable element inside the context the method will return undefined

Parameters:
element    
contextElement    
Return:
Object

isConnectedAndVisible

public static Object isConnectedAndVisible(Object el)

Tests whether the element and its ancestors are connected to the document and visible.

Parameters:
el    
Return:
Object - true if el is connected and visible.

isFocusable

public static Object isFocusable(Object el,
                                 Object context)

isFocusable determines whether the HTML element el is focusable. An element is focusable if: 1. The element is of a type which accepts the keyboard focus, or tabIndex has been explicitly set to enable focusing. 2. It is not disabled. 3. It is in a visible subtree. 4. It is in a connected subtree.

Parameters:
el  -  the element to check
context  -  optional context object for caching the results of isConnectedAndVisible() calls
Return:
Object - true if el is focuasble.

isFocusChangePending

public static Boolean isFocusChangePending()

Tests whether a focus change is pending. In some cases, eg. in screen reader mode, calls to focusElement() may not result in an immediate call to domElement.focus(). Instead, the actual call to domElement.focus() may be delayed. This method checks whether such a delayed call to domElement.focus() is pending. This is currently only needed by popup restore focus code. The popup restore focus code does not want to restore the focus if the app developer or peer author has already called focusElement() to move the focus somewhere else.

Return:
Boolean - True if a delayed call to domElement.focus() is pending, false otherwise.

isTabStop

public static Object isTabStop(Object el)

isTabStop determines whether the HTML element el is a tab-stop in the current state of the page.

Parameters:
el    
Return:
Object - true if el is a tabstop

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Generated on 2010.12.10 19:37 UTC
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.