Path: blob/master/src/java.desktop/share/classes/javax/accessibility/AccessibleAction.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* The {@code AccessibleAction} interface should be supported by any object that29* can perform one or more actions. This interface provides the standard30* mechanism for an assistive technology to determine what those actions are as31* well as tell the object to perform them. Any object that can be manipulated32* should support this interface. Applications can determine if an object33* supports the {@code AccessibleAction} interface by first obtaining its34* {@code AccessibleContext} (see {@link Accessible}) and then calling the35* {@link AccessibleContext#getAccessibleAction} method. If the return value is36* not {@code null}, the object supports this interface.37*38* @author Peter Korn39* @author Hans Muller40* @author Willie Walker41* @author Lynn Monsanto42* @see Accessible43* @see Accessible#getAccessibleContext44* @see AccessibleContext45* @see AccessibleContext#getAccessibleAction46*/47public interface AccessibleAction {4849/**50* An action which causes a tree node to collapse if expanded and expand if51* collapsed.52*53* @since 1.554*/55public static final String TOGGLE_EXPAND =56new String ("toggleexpand");5758/**59* An action which increments a value.60*61* @since 1.562*/63public static final String INCREMENT =64new String ("increment");656667/**68* An action which decrements a value.69*70* @since 1.571*/72public static final String DECREMENT =73new String ("decrement");7475/**76* An action which causes a component to execute its default action.77*78* @since 1.679*/80public static final String CLICK = new String("click");8182/**83* An action which causes a popup to become visible if it is hidden and84* hidden if it is visible.85*86* @since 1.687*/88public static final String TOGGLE_POPUP = new String("toggle popup");8990/**91* Returns the number of accessible actions available in this object If92* there are more than one, the first one is considered the "default" action93* of the object.94*95* @return the zero-based number of actions in this object96*/97public int getAccessibleActionCount();9899/**100* Returns a description of the specified action of the object.101*102* @param i zero-based index of the actions103* @return a {@code String} description of the action104* @see #getAccessibleActionCount105*/106public String getAccessibleActionDescription(int i);107108/**109* Performs the specified action on the object.110*111* @param i zero-based index of actions112* @return {@code true} if the action was performed; otherwise {@code false}113* @see #getAccessibleActionCount114*/115public boolean doAccessibleAction(int i);116}117118119