From Apache OpenOffice Wiki
Jump to: navigation, search

In addition to the parent-child relationship that defines the accessibility object tree, each accessible object may have one or more relations to other accessible objects, independent of that hierarchy. The types of possible relations are defined and explained in the com.sun.star.accessibility.AccessibleRelationType set of constants.

One example is the LABEL_FOR and LABELED_BY pair of relations that is used to express the case where one object is the label for a one or more controls of the GUI. The label and its controls may be spatially adjacent to make their relationship clear to the sighted user. But in the accessibility object tree, they may belong to different sub-trees. With a set of relations, these objects can be linked together.

Each relation is an com.sun.star.accessibility.AccessibleRelation structure that contains the relation type and a set of references to its target objects. In the previous example, there would be one LABEL_FOR relation for the label with all its controls in the target set and one LABELED_BY relation from each control to the label.

For each relation type there may be one relation belonging to a relation set as represented by the com.sun.star.accessibility.XAccessibleRelationSet interface. Therefore, the number of relations that is returned by getRelationCount() can not be greater than the number of relation types. Relations can be accessed either by calling the getRelation() function with an index, or by calling the RelationType() function with a relation type. Note that there are no fixed mappings from relation types to indices. You can test whether a relation set contains a relation of a given type by using the containsRelation() function.

Documentation note.png The relation set returned by com.sun.star.accessibility.XAccessibleContext:getAccessibleRelationSet() returns a copy of the relation set of an accessible object. Modifying that copy does not change the relation set of the object.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages