KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > accessibility > AccessibleSelection


1 /*
2  * @(#)AccessibleSelection.java 1.14 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.accessibility;
9
10 /**
11  * This AccessibleSelection interface
12  * provides the standard mechanism for an assistive technology to determine
13  * what the current selected children are, as well as modify the selection set.
14  * Any object that has children that can be selected should support
15  * the AccessibleSelection interface. Applications can determine if an object supports the
16  * AccessibleSelection interface by first obtaining its AccessibleContext (see
17  * {@link Accessible}) and then calling the
18  * {@link AccessibleContext#getAccessibleSelection} method.
19  * If the return value is not null, the object supports this interface.
20  *
21  * @see Accessible
22  * @see Accessible#getAccessibleContext
23  * @see AccessibleContext
24  * @see AccessibleContext#getAccessibleSelection
25  *
26  * @version 1.7 08/26/98 21:14:11
27  * @author Peter Korn
28  * @author Hans Muller
29  * @author Willie Walker
30  */

31 public interface AccessibleSelection {
32
33     /**
34      * Returns the number of Accessible children currently selected.
35      * If no children are selected, the return value will be 0.
36      *
37      * @return the number of items currently selected.
38      */

39      public int getAccessibleSelectionCount();
40
41     /**
42      * Returns an Accessible representing the specified selected child
43      * of the object. If there isn't a selection, or there are
44      * fewer children selected than the integer passed in, the return
45      * value will be null.
46      * <p>Note that the index represents the i-th selected child, which
47      * is different from the i-th child.
48      *
49      * @param i the zero-based index of selected children
50      * @return the i-th selected child
51      * @see #getAccessibleSelectionCount
52      */

53      public Accessible JavaDoc getAccessibleSelection(int i);
54
55     /**
56      * Determines if the current child of this object is selected.
57      *
58      * @return true if the current child of this object is selected; else false.
59      * @param i the zero-based index of the child in this Accessible object.
60      * @see AccessibleContext#getAccessibleChild
61      */

62      public boolean isAccessibleChildSelected(int i);
63
64     /**
65      * Adds the specified Accessible child of the object to the object's
66      * selection. If the object supports multiple selections,
67      * the specified child is added to any existing selection, otherwise
68      * it replaces any existing selection in the object. If the
69      * specified child is already selected, this method has no effect.
70      *
71      * @param i the zero-based index of the child
72      * @see AccessibleContext#getAccessibleChild
73      */

74      public void addAccessibleSelection(int i);
75
76     /**
77      * Removes the specified child of the object from the object's
78      * selection. If the specified item isn't currently selected, this
79      * method has no effect.
80      *
81      * @param i the zero-based index of the child
82      * @see AccessibleContext#getAccessibleChild
83      */

84      public void removeAccessibleSelection(int i);
85
86     /**
87      * Clears the selection in the object, so that no children in the
88      * object are selected.
89      */

90      public void clearAccessibleSelection();
91
92     /**
93      * Causes every child of the object to be selected
94      * if the object supports multiple selections.
95      */

96      public void selectAllAccessibleSelection();
97 }
98
Popular Tags