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


public interface AccessibleContext

AccessibleContext represents the minimum information all accessible objects provide. 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:
BlackBerry API 4.6.1

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()
          Returns the parent context of this, typically the containing Manager or Screen.
 int getAccessibleRole()
          Returns accessible role of the element.
 AccessibleContext getAccessibleSelectionAt(int index)
          Returns the context of a selected item indicated by index out of the collection of selected items.
 int getAccessibleSelectionCount()
          Returns the number of items currently selected.
 int getAccessibleStateSet()
          Returns current set of states.
 AccessibleTable getAccessibleTable()
          Returns 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 or not state is set on this accessible element.
 



Field Detail

ACCESSIBLE_STATE_CHANGED

static final int ACCESSIBLE_STATE_CHANGED
Specifies accessible state transition event type. Can be fired by all accessible elements.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.1

ACCESSIBLE_TEXT_CHANGED

static final int ACCESSIBLE_TEXT_CHANGED
Specifies text change event. Usually fired by AccessibleText elements.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.1

ACCESSIBLE_CARET_CHANGED

static final int ACCESSIBLE_CARET_CHANGED
Specifies caret movement event. Usually fired by AccessibleText elements.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.1

ACCESSIBLE_CHILD_CHANGED

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.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.1

ACCESSIBLE_SELECTION_CHANGED

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.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.1

ACCESSIBLE_VALUE_CHANGED

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 AccessibleContext.getAccessibleValue() method.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.1

ACCESSIBLE_NAME_CHANGED

static final int ACCESSIBLE_NAME_CHANGED
Specifies element name change. Fired by any accessible element when its name changes.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.1


Method Detail

getAccessibleChildAt

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:
BlackBerry API 4.6.1

getAccessibleChildCount

int getAccessibleChildCount()
Return number of children for conatiners.

Returns:
number of children if container, 0 otherwise.
Since:
BlackBerry API 4.6.1

getAccessibleName

String getAccessibleName()
Returns accessible name of the element.

Returns:
accessible name of field if available, null otherwise.
Since:
BlackBerry API 4.6.1

getAccessibleParent

AccessibleContext getAccessibleParent()
Returns the parent context of this, typically the containing Manager or Screen.

For Screens/Dialogs this returns null.

For Fields - this returns the Screen (e.g. Dialog) containing the Field.

For complex Field elements (e.g. menu items, etc) - this returns the Field (e.g. menu.

Returns:
accessible parent of the this component if available, null otherwise.
Since:
BlackBerry API 4.6.1

getAccessibleRole

int getAccessibleRole()
Returns accessible role of the element.

Returns:
accessible role of field
See Also:
AccessibleRole
Since:
BlackBerry API 4.6.1

getAccessibleSelectionAt

AccessibleContext getAccessibleSelectionAt(int index)
Returns the context of a selected item indicated by index out of the collection of selected items.

For cases 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 - Index of selelected item, does not correspond to the child index.
Returns:
the ith selected child.
Since:
BlackBerry API 4.6.1

getAccessibleSelectionCount

int getAccessibleSelectionCount()
Returns the number of items currently selected. If no children are selected, returns 0.

Returns:
number of selected children if any.
Since:
BlackBerry API 4.6.1

getAccessibleStateSet

int getAccessibleStateSet()
Returns current set of states. The value represents a mask with bit flags.

Returns:
set of accessible states currently set on this field.
See Also:
AccessibleState
Since:
BlackBerry API 4.6.1

getAccessibleTable

AccessibleTable getAccessibleTable()
Returns the AccessibleTable associated with an object.

Returns:
an AccessibleTable if supported by object, otherwise null.
Since:
BlackBerry API 4.6.1

getAccessibleText

AccessibleText getAccessibleText()
Returns accessible text for textual fields.

Returns:
accessible text of the field if available, otherwise null.
Since:
BlackBerry API 4.6.1

getAccessibleValue

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.

Returns:
accessible value if available, otherwise null.
Since:
BlackBerry API 4.6.1

isAccessibleChildSelected

boolean isAccessibleChildSelected(int index)
Determines if the current child of this object is selected.

Parameters:
index - Index of child.
Returns:
true if child is selected.
Since:
BlackBerry API 4.6.1

isAccessibleStateSet

boolean isAccessibleStateSet(int state)
Determines whether or not state is set on this 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:
BlackBerry API 4.6.1





Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.