net.rim.device.api.ui.accessibility
Interface AccessibleContext


public interface AccessibleContext

AccessibleContext represents the minimum information all accessible objects return. This information includes the accessible name, role, and state of the object, as well as information about its parent and children. AccessibleContext also contains methods for obtaining more specific accessibility information about a component. If the component supports them, these methods will return an object that implements one or more of the following interfaces:

Since:
JDE 4.7.0

Field Summary
static int ACCESSIBLE_CARET_CHANGED
          Specifies caret movement event.
static int ACCESSIBLE_CHILD_CHANGED
          Specifies child change event.
static int ACCESSIBLE_NAME_CHANGED
          Specifies element name change.
static int ACCESSIBLE_SELECTION_CHANGED
          Specifies selection change event.
static int ACCESSIBLE_STATE_CHANGED
          Specifies accessible state transition event type.
static int ACCESSIBLE_TEXT_CHANGED
          Specifies text change event.
static int ACCESSIBLE_VALUE_CHANGED
          Specifies numerical or sequential value change.
 
Method Summary
 AccessibleContext getAccessibleChildAt(int index)
          Returns the specified Accessible child of the object.
 int getAccessibleChildCount()
          Return number of children for conatiners
 String getAccessibleName()
          Returns accessible name of the element.
 AccessibleContext getAccessibleParent()
          For Screens/Dialogs this returns null For Fields - this returns the Screen/Dialog containing the Field For complex Field elements (ex: menu items, etc) - this returns the Field (ex: menu, etc)
 int getAccessibleRole()
          Returns accessible role of the element.
 AccessibleContext getAccessibleSelectionAt(int index)
          This method returns an AccessibleContext that is currently selected where the index is the index in the list of selected items For classes where there is only 1 item selected at a time only the index of 0 is valid For classes that allow multi-selection the index is the position in the list of selected items where 0 indicates the start of the selection
 int getAccessibleSelectionCount()
          Returns the number of Accessible children currently selected.
 int getAccessibleStateSet()
          Returns current states set.
 AccessibleTable getAccessibleTable()
          Gets the AccessibleTable associated with an object
 AccessibleText getAccessibleText()
          Returns accessible text for textual fields.
 AccessibleValue getAccessibleValue()
          Returns accessible value for numerical fields.
 boolean isAccessibleChildSelected(int index)
          Determines if the current child of this object is selected.
 boolean isAccessibleStateSet(int state)
          Determines whether the particular state is set on accessible element.
 

Field Detail

ACCESSIBLE_CARET_CHANGED

public static final int ACCESSIBLE_CARET_CHANGED
Specifies caret movement event. Usually fired by AccessibleText elements.
Since:
JDE 4.7.0

ACCESSIBLE_CHILD_CHANGED

public static final int ACCESSIBLE_CHILD_CHANGED
Specifies child change event. Fired by container UI elements, such as Screen, ListField, ComboFields, etc. when child is added or removed from the container.

The two notification parameters in the AccessibleEventListener.accessibleEventOccurred(int, Object, Object, AccessibleContext) method may optionally provide information about which container elements have been removed and added. This may help assistive technology to read only the affected elements if container has many of them. Both parameters are optional, however, if any of them is provided then the set must be complete meaning no other components were added or removed from the container. For example, if a screen changes dramatically affecting many fields then it is better to pass NULL parameter values indicating that screen reader should re-read the whole screen. On the other hand if relatively small number of fields were added or removed from the screen with big number of fields then it is advised to provide only the set of changed fields. In order to pass affected elements the two method parameter should be an array with the following type: AccessibleContext[]. The oldValue (2nd method parameter) contains container elements that existed before the notification and were removed. Similarly, the newValue (3rd method parameter) contains new elements that were added.

Since:
JDE 4.7.0

ACCESSIBLE_NAME_CHANGED

public static final int ACCESSIBLE_NAME_CHANGED
Specifies element name change. Fired by any accessible element when its name changes.
Since:
JDE 4.7.0

ACCESSIBLE_SELECTION_CHANGED

public static final int ACCESSIBLE_SELECTION_CHANGED
Specifies selection change event. Fired by container elements that have its children selected, such as ListField, TreeField, Tables. Also fired by a TextField when user changes text selection.
Since:
JDE 4.7.0

ACCESSIBLE_STATE_CHANGED

public static final int ACCESSIBLE_STATE_CHANGED
Specifies accessible state transition event type. Can be fired by all accessible elements.
Since:
JDE 4.7.0

ACCESSIBLE_TEXT_CHANGED

public static final int ACCESSIBLE_TEXT_CHANGED
Specifies text change event. Usually fired by AccessibleText elements.
Since:
JDE 4.7.0

ACCESSIBLE_VALUE_CHANGED

public static final int ACCESSIBLE_VALUE_CHANGED
Specifies numerical or sequential value change. Fired by GaugeField that has range of values and DateField children such as Month field. This event may be fired by a component that doesn't support getAccessibleValue() method.
Since:
JDE 4.7.0
Method Detail

getAccessibleChildAt

public AccessibleContext getAccessibleChildAt(int index)
Returns the specified Accessible child of the object. The Accessible children of an Accessible object are zero-based, so the first child of an Accessible child is at index 0, the second child is at index 1, and so on.
Parameters:
index - - index of child requested
Returns:
child at index if within limits, null otherwise
Since:
JDE 4.7.0

getAccessibleChildCount

public int getAccessibleChildCount()
Return number of children for conatiners
Returns:
number of children if container, 0 otherwise
Since:
JDE 4.7.0

getAccessibleName

public String getAccessibleName()
Returns accessible name of the element.
Returns:
accessible name of field if available, null otherwise
Since:
JDE 4.7.0

getAccessibleParent

public AccessibleContext getAccessibleParent()
For Screens/Dialogs this returns null For Fields - this returns the Screen/Dialog containing the Field For complex Field elements (ex: menu items, etc) - this returns the Field (ex: menu, etc)
Returns:
accessible parent of the this component if available, null otherwise
Since:
JDE 4.7.0

getAccessibleRole

public int getAccessibleRole()
Returns accessible role of the element.
Returns:
accessible role of field
Since:
JDE 4.7.0
See Also:
AccessibleRole

getAccessibleSelectionAt

public AccessibleContext getAccessibleSelectionAt(int index)
This method returns an AccessibleContext that is currently selected where the index is the index in the list of selected items For classes where there is only 1 item selected at a time only the index of 0 is valid For classes that allow multi-selection the index is the position in the list of selected items where 0 indicates the start of the selection
Parameters:
index - of selelected item, does not correspond to the child index
Returns:
the i-th selected child
Since:
JDE 4.7.0

getAccessibleSelectionCount

public int getAccessibleSelectionCount()
Returns the number of Accessible children currently selected. If no children are selected, the return value will be 0.
Returns:
number of selected children if any
Since:
JDE 4.7.0

getAccessibleStateSet

public int getAccessibleStateSet()
Returns current states set. The value represents a mask with bit flags.
Returns:
set of accessible states currently set on this field
Since:
JDE 4.7.0
See Also:
AccessibleState

getAccessibleTable

public AccessibleTable getAccessibleTable()
Gets the AccessibleTable associated with an object
Returns:
an AccessibleTable if supported by object; otherwise return null
Since:
JDE 4.7.0

getAccessibleText

public AccessibleText getAccessibleText()
Returns accessible text for textual fields.
Returns:
accessible text of the field if available, null otherwise
Since:
JDE 4.7.0

getAccessibleValue

public AccessibleValue getAccessibleValue()
Returns accessible value for numerical fields. This method should is supported by components that represent ranged set of numerical values, such as GaugeField. Those fields that have ranged non-numerical values won't utilize this method, such as DateField children.
Returns:
accessible value if available, null otherwise
Since:
JDE 4.7.0

isAccessibleChildSelected

public boolean isAccessibleChildSelected(int index)
Determines if the current child of this object is selected.
Parameters:
index - of child
Returns:
true if child is selected
Since:
JDE 4.7.0

isAccessibleStateSet

public boolean isAccessibleStateSet(int state)
Determines whether the particular state is set on accessible element.

The method parameter should be one of the states flags constants from the AccessibleState class. If the state method parameter contains more than one states flag then the returning value will be true if any of the given states is possessed by the component, false if component doesn't have any of the given states.

Parameters:
state - - determine if this state flag belongs to the set
Returns:
true if the state is in the set
Since:
JDE 4.7.0



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.