Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/accessibility/AccessibleSelection.java
38829 views
/*1* Copyright (c) 1997, 1999, 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 AccessibleSelection interface29* provides the standard mechanism for an assistive technology to determine30* what the current selected children are, as well as modify the selection set.31* Any object that has children that can be selected should support32* the AccessibleSelection interface. Applications can determine if an object supports the33* AccessibleSelection interface by first obtaining its AccessibleContext (see34* {@link Accessible}) and then calling the35* {@link AccessibleContext#getAccessibleSelection} method.36* If the return value is not null, the object supports this interface.37*38* @see Accessible39* @see Accessible#getAccessibleContext40* @see AccessibleContext41* @see AccessibleContext#getAccessibleSelection42*43* @author Peter Korn44* @author Hans Muller45* @author Willie Walker46*/47public interface AccessibleSelection {4849/**50* Returns the number of Accessible children currently selected.51* If no children are selected, the return value will be 0.52*53* @return the number of items currently selected.54*/55public int getAccessibleSelectionCount();5657/**58* Returns an Accessible representing the specified selected child59* of the object. If there isn't a selection, or there are60* fewer children selected than the integer passed in, the return61* value will be null.62* <p>Note that the index represents the i-th selected child, which63* is 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* @return true if the current child of this object is selected; else false.75* @param i the zero-based index of the child in this Accessible object.76* @see AccessibleContext#getAccessibleChild77*/78public boolean isAccessibleChildSelected(int i);7980/**81* Adds the specified Accessible child of the object to the object's82* selection. If the object supports multiple selections,83* the specified child is added to any existing selection, otherwise84* it replaces any existing selection in the object. If the85* specified child is already selected, this method has no effect.86*87* @param i the zero-based index of the child88* @see AccessibleContext#getAccessibleChild89*/90public void addAccessibleSelection(int i);9192/**93* Removes the specified child of the object from the object's94* selection. If the specified item isn't currently selected, this95* method has no effect.96*97* @param i the zero-based index of the child98* @see AccessibleContext#getAccessibleChild99*/100public void removeAccessibleSelection(int i);101102/**103* Clears the selection in the object, so that no children in the104* object are selected.105*/106public void clearAccessibleSelection();107108/**109* Causes every child of the object to be selected110* if the object supports multiple selections.111*/112public void selectAllAccessibleSelection();113}114115116