001 /*
002 * Copyright 1997-1999 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025
026 package javax.accessibility;
027
028 /**
029 * This AccessibleSelection interface
030 * provides the standard mechanism for an assistive technology to determine
031 * what the current selected children are, as well as modify the selection set.
032 * Any object that has children that can be selected should support
033 * the AccessibleSelection interface. Applications can determine if an object supports the
034 * AccessibleSelection interface by first obtaining its AccessibleContext (see
035 * {@link Accessible}) and then calling the
036 * {@link AccessibleContext#getAccessibleSelection} method.
037 * If the return value is not null, the object supports this interface.
038 *
039 * @see Accessible
040 * @see Accessible#getAccessibleContext
041 * @see AccessibleContext
042 * @see AccessibleContext#getAccessibleSelection
043 *
044 * @version 1.7 08/26/98 21:14:11
045 * @author Peter Korn
046 * @author Hans Muller
047 * @author Willie Walker
048 */
049 public interface AccessibleSelection {
050
051 /**
052 * Returns the number of Accessible children currently selected.
053 * If no children are selected, the return value will be 0.
054 *
055 * @return the number of items currently selected.
056 */
057 public int getAccessibleSelectionCount();
058
059 /**
060 * Returns an Accessible representing the specified selected child
061 * of the object. If there isn't a selection, or there are
062 * fewer children selected than the integer passed in, the return
063 * value will be null.
064 * <p>Note that the index represents the i-th selected child, which
065 * is different from the i-th child.
066 *
067 * @param i the zero-based index of selected children
068 * @return the i-th selected child
069 * @see #getAccessibleSelectionCount
070 */
071 public Accessible getAccessibleSelection(int i);
072
073 /**
074 * Determines if the current child of this object is selected.
075 *
076 * @return true if the current child of this object is selected; else false.
077 * @param i the zero-based index of the child in this Accessible object.
078 * @see AccessibleContext#getAccessibleChild
079 */
080 public boolean isAccessibleChildSelected(int i);
081
082 /**
083 * Adds the specified Accessible child of the object to the object's
084 * selection. If the object supports multiple selections,
085 * the specified child is added to any existing selection, otherwise
086 * it replaces any existing selection in the object. If the
087 * specified child is already selected, this method has no effect.
088 *
089 * @param i the zero-based index of the child
090 * @see AccessibleContext#getAccessibleChild
091 */
092 public void addAccessibleSelection(int i);
093
094 /**
095 * Removes the specified child of the object from the object's
096 * selection. If the specified item isn't currently selected, this
097 * method has no effect.
098 *
099 * @param i the zero-based index of the child
100 * @see AccessibleContext#getAccessibleChild
101 */
102 public void removeAccessibleSelection(int i);
103
104 /**
105 * Clears the selection in the object, so that no children in the
106 * object are selected.
107 */
108 public void clearAccessibleSelection();
109
110 /**
111 * Causes every child of the object to be selected
112 * if the object supports multiple selections.
113 */
114 public void selectAllAccessibleSelection();
115 }
|