J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 1997-1999 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | * accompanied this code). |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License version |
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | |
| 26 | package javax.accessibility; |
| 27 | |
| 28 | /** |
| 29 | * This AccessibleSelection interface |
| 30 | * provides the standard mechanism for an assistive technology to determine |
| 31 | * what the current selected children are, as well as modify the selection set. |
| 32 | * Any object that has children that can be selected should support |
| 33 | * the AccessibleSelection interface. Applications can determine if an object supports the |
| 34 | * AccessibleSelection interface by first obtaining its AccessibleContext (see |
| 35 | * {@link Accessible}) and then calling the |
| 36 | * {@link AccessibleContext#getAccessibleSelection} method. |
| 37 | * If the return value is not null, the object supports this interface. |
| 38 | * |
| 39 | * @see Accessible |
| 40 | * @see Accessible#getAccessibleContext |
| 41 | * @see AccessibleContext |
| 42 | * @see AccessibleContext#getAccessibleSelection |
| 43 | * |
| 44 | * @author Peter Korn |
| 45 | * @author Hans Muller |
| 46 | * @author Willie Walker |
| 47 | */ |
| 48 | public interface AccessibleSelection { |
| 49 | |
| 50 | /** |
| 51 | * Returns the number of Accessible children currently selected. |
| 52 | * If no children are selected, the return value will be 0. |
| 53 | * |
| 54 | * @return the number of items currently selected. |
| 55 | */ |
| 56 | public int getAccessibleSelectionCount(); |
| 57 | |
| 58 | /** |
| 59 | * Returns an Accessible representing the specified selected child |
| 60 | * of the object. If there isn't a selection, or there are |
| 61 | * fewer children selected than the integer passed in, the return |
| 62 | * value will be null. |
| 63 | * <p>Note that the index represents the i-th selected child, which |
| 64 | * is different from the i-th child. |
| 65 | * |
| 66 | * @param i the zero-based index of selected children |
| 67 | * @return the i-th selected child |
| 68 | * @see #getAccessibleSelectionCount |
| 69 | */ |
| 70 | public Accessible getAccessibleSelection(int i); |
| 71 | |
| 72 | /** |
| 73 | * Determines if the current child of this object is selected. |
| 74 | * |
| 75 | * @return true if the current child of this object is selected; else false. |
| 76 | * @param i the zero-based index of the child in this Accessible object. |
| 77 | * @see AccessibleContext#getAccessibleChild |
| 78 | */ |
| 79 | public boolean isAccessibleChildSelected(int i); |
| 80 | |
| 81 | /** |
| 82 | * Adds the specified Accessible child of the object to the object's |
| 83 | * selection. If the object supports multiple selections, |
| 84 | * the specified child is added to any existing selection, otherwise |
| 85 | * it replaces any existing selection in the object. If the |
| 86 | * specified child is already selected, this method has no effect. |
| 87 | * |
| 88 | * @param i the zero-based index of the child |
| 89 | * @see AccessibleContext#getAccessibleChild |
| 90 | */ |
| 91 | public void addAccessibleSelection(int i); |
| 92 | |
| 93 | /** |
| 94 | * Removes the specified child of the object from the object's |
| 95 | * selection. If the specified item isn't currently selected, this |
| 96 | * method has no effect. |
| 97 | * |
| 98 | * @param i the zero-based index of the child |
| 99 | * @see AccessibleContext#getAccessibleChild |
| 100 | */ |
| 101 | public void removeAccessibleSelection(int i); |
| 102 | |
| 103 | /** |
| 104 | * Clears the selection in the object, so that no children in the |
| 105 | * object are selected. |
| 106 | */ |
| 107 | public void clearAccessibleSelection(); |
| 108 | |
| 109 | /** |
| 110 | * Causes every child of the object to be selected |
| 111 | * if the object supports multiple selections. |
| 112 | */ |
| 113 | public void selectAllAccessibleSelection(); |
| 114 | } |