Path: blob/master/src/java.desktop/share/classes/javax/accessibility/AccessibleSelection.java
41153 views
/*1* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.accessibility;2627/**28* This {@code AccessibleSelection} interface provides the standard mechanism29* for an assistive technology to determine what the current selected children30* are, as well as modify the selection set. Any object that has children that31* can be selected should support the {@code AccessibleSelection} interface.32* Applications can determine if an object supports the33* {@code AccessibleSelection} interface by first obtaining its34* {@code AccessibleContext} (see {@link Accessible}) and then calling the35* {@link AccessibleContext#getAccessibleSelection} method. If the return value36* is not {@code null}, the object supports this interface.37*38* @author Peter Korn39* @author Hans Muller40* @author Willie Walker41* @see Accessible42* @see Accessible#getAccessibleContext43* @see AccessibleContext44* @see AccessibleContext#getAccessibleSelection45*/46public interface AccessibleSelection {4748/**49* Returns the number of {@code Accessible} children currently selected. If50* no children are selected, the return value will be 0.51*52* @return the number of items currently selected53*/54public int getAccessibleSelectionCount();5556/**57* Returns an {@code Accessible} representing the specified selected child58* of the object. If there isn't a selection, or there are fewer children59* selected than the integer passed in, the return value will be60* {@code null}.61* <p>62* Note that the index represents the i-th selected child, which is63* different from the i-th child.64*65* @param i the zero-based index of selected children66* @return the i-th selected child67* @see #getAccessibleSelectionCount68*/69public Accessible getAccessibleSelection(int i);7071/**72* Determines if the current child of this object is selected.73*74* @param i the zero-based index of the child in this {@code Accessible}75* object76* @return {@code true} if the current child of this object is selected;77* else {@code false}78* @see AccessibleContext#getAccessibleChild79*/80public boolean isAccessibleChildSelected(int i);8182/**83* Adds the specified {@code Accessible} child of the object to the object's84* selection. If the object supports multiple selections, the specified85* child is added to any existing selection, otherwise it replaces any86* existing selection in the object. If the specified child is already87* selected, this method has no effect.88*89* @param i the zero-based index of the child90* @see AccessibleContext#getAccessibleChild91*/92public void addAccessibleSelection(int i);9394/**95* Removes the specified child of the object from the object's selection. If96* the specified item isn't currently selected, this method has no effect.97*98* @param i the zero-based index of the child99* @see AccessibleContext#getAccessibleChild100*/101public void removeAccessibleSelection(int i);102103/**104* Clears the selection in the object, so that no children in the object are105* selected.106*/107public void clearAccessibleSelection();108109/**110* Causes every child of the object to be selected if the object supports111* multiple selections.112*/113public void selectAllAccessibleSelection();114}115116117