Checkpoint 502.3.7: Hierarchical Relationships

Any hierarchical (parent-child) relationship that a component has as a container for, or being contained by, another component shall be programmatically determinable.

Rationale

Someone who is blind uses a computer with the aid of assistive technology (AT) such as a screen reader, screen magnifier, speech recognition or Braille display. The software must provide semantic information about the user interface objects to the AT, including the parent or containing element of the control and any of its child components. This allows users to understand how to navigate through and interact with the user interface controls. For example, users may be exploring a Folder view. They tab to the topmost node or folder in the view and the AT announces that it has five items. Users can then use the arrow keys to move through the five items under the parent folder and discover the folder's contents.

Development Techniques

Note: Review the General techniques as well as other tabs applicable to your technology.  Prioritize the use of technology-specific techniques, and implement the General techniques as needed. You are always required to find, understand and implement accessible code techniques to meet the checkpoint. The documented techniques and supplements are not exhaustive; they illustrate acceptable ways to achieve the spirit of the checkpoint. If numbered, techniques are in order of preference, with recommended techniques listed first.

General techniques

Instructions: Where applicable, each item in this section represents a technique deemed sufficient.

  • Programmatically exposing the parent of all user interface objects
  • Programmatically exposing the children, if any, of all user interface objects
  • Programmatically exposing any relations between user interface objects and those that contain them

Mobile Native (iOS) techniques

There are no specific Mobile Native iOS techniques for this checkpoint. Refer to the General techniques section.

Eclipse techniques

Instructions: In addition to the General techniques, any item in this section represents a technique deemed sufficient where appropriate.

Implementing AccessibleListener to return name of parent and its children

Follow the development technique Implement AccessibleListener for control and its children outlined in checkpoint 502.3.1 Object Information to programmatically expose the name of a parent control and its children.

 

Implementing AccessibleControlListener to return information about child elements

Add an org.eclipse.swt.accessibility.AccessibleControlListener to the Accessible of a control and implement getChild, getChildAtPoint, getChildCount and getChildren methods.

Chapter 8 Canvas Custom Controls of the article, Creating Accessible Applications with Eclipse, provides a sample implementation of the getChild, getChildAtPoint, getChildCount and getChildren methods for a DatePicker control and its children.

Adding relations between objects and those containing them

Call the addRelation method on a Control’s Accessible to define relations between the control and other controls. For example, the SWT Snippet 350 Use accessible relations to provide additional information to an AT, adds relations to a Group control declaring the Street and City Text edit controls members of the address group containing them by specifying ACC.RELATION_MEMBER_OF for the relation.

The class org.eclipse.swt.accessibility.ACC defines a set of constants to assist in defining relations between a control and its children.

Windows-based (MSAA+IA2) techniques

Instructions: In addition to the General techniques, refer to the Windows techniques tab in checkpoint 502.3.1 Object Information to learn about accessibility APIs, and use the following to support Windows accessibilty.

Returning object information for a custom control and its children

Follow the Windows-based (MSAA+IA2) development technique For customized Windows controls implement IAccessible, IAccessible2 and IServiceProvider of checkpoint  502.3.1 Object Information to programmatically expose object information of a parent control and its children by implementing IAccessible for the control and the child objects it contains. Return relationship information between the parent and its children by implementing get_accChild, get_accChildCount and get_accParent methods on the respective Accessible objects. Provide an IAccessible2::uniqueID property for the parent and each of its children.

Refer to the IAccessible2 Implementation Guide for full details on providing IAccessible, IAccessible2 and IServiceProvider interfaces as well information about the IAccessible2::uniqueID property.

Adding relations between objects and those containing them

Describe relationships between a parent control and its children by defining an IAccessibleRelation between the parent control and each child on the IAccessible2 objects for each control.

Accessible relation types are defined in IA2_RELATION constant variables. The constants are prefixed with IA2_RELATION_* indicating the type of relation. The accessible relation types describing parent child relationships include EMBEDS/EMBEDDED_BY, used exclusively for rich text controls, FLOWS_TO/FLOWS_FROM, used to describe relations in a flowchart, MEMBER_OF to describe members of a group, NODE_CHILD_OF, PARENT_WINDOW_OF and SUBWINDOW_OF.This list is not exhaustive, refer to IA2_RELATION constants for a complete list of relation types.


Most links in this checklist reside outside ibm.com at the Web Content Accessibility Guidelines (WCAG) 2.0. W3C Recommendation 11 December 2008: http://www.w3.org/TR/WCAG20/

Copyright © 1994-2017 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University, Beihang University). All Rights Reserved.

Copyright © 2001, 2017 IBM Corporation