jdk/src/java.desktop/share/classes/javax/accessibility/AccessibleAction.java
changeset 45649 499d43823920
parent 25859 3317bb8137f4
equal deleted inserted replaced
45648:87c997b74bb8 45649:499d43823920
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    24  */
    24  */
    25 
    25 
    26 package javax.accessibility;
    26 package javax.accessibility;
    27 
    27 
    28 /**
    28 /**
    29  * The AccessibleAction interface should be supported by any object
    29  * The {@code AccessibleAction} interface should be supported by any object that
    30  * that can perform one or more actions.  This interface
    30  * can perform one or more actions. This interface provides the standard
    31  * provides the standard mechanism for an assistive technology to determine
    31  * mechanism for an assistive technology to determine what those actions are as
    32  * what those actions are as well as tell the object to perform them.
    32  * well as tell the object to perform them. Any object that can be manipulated
    33  * Any object that can be manipulated should support this
    33  * should support this interface. Applications can determine if an object
    34  * interface.  Applications can determine if an object supports the
    34  * supports the {@code AccessibleAction} interface by first obtaining its
    35  * AccessibleAction interface by first obtaining its AccessibleContext (see
    35  * {@code AccessibleContext} (see {@link Accessible}) and then calling the
    36  * {@link Accessible}) and then calling the {@link AccessibleContext#getAccessibleAction}
    36  * {@link AccessibleContext#getAccessibleAction} method. If the return value is
    37  * method.  If the return value is not null, the object supports this interface.
    37  * not {@code null}, the object supports this interface.
    38  *
    38  *
       
    39  * @author Peter Korn
       
    40  * @author Hans Muller
       
    41  * @author Willie Walker
       
    42  * @author Lynn Monsanto
    39  * @see Accessible
    43  * @see Accessible
    40  * @see Accessible#getAccessibleContext
    44  * @see Accessible#getAccessibleContext
    41  * @see AccessibleContext
    45  * @see AccessibleContext
    42  * @see AccessibleContext#getAccessibleAction
    46  * @see AccessibleContext#getAccessibleAction
    43  *
       
    44  * @author      Peter Korn
       
    45  * @author      Hans Muller
       
    46  * @author      Willie Walker
       
    47  * @author      Lynn Monsanto
       
    48  */
    47  */
    49 public interface AccessibleAction {
    48 public interface AccessibleAction {
    50 
    49 
    51     /**
    50     /**
    52      * An action which causes a tree node to
    51      * An action which causes a tree node to collapse if expanded and expand if
    53      * collapse if expanded and expand if collapsed.
    52      * collapsed.
       
    53      *
    54      * @since 1.5
    54      * @since 1.5
    55      */
    55      */
    56     public static final String TOGGLE_EXPAND =
    56     public static final String TOGGLE_EXPAND =
    57         new String ("toggleexpand");
    57         new String ("toggleexpand");
    58 
    58 
    59     /**
    59     /**
    60      * An action which increments a value.
    60      * An action which increments a value.
       
    61      *
    61      * @since 1.5
    62      * @since 1.5
    62      */
    63      */
    63     public static final String INCREMENT =
    64     public static final String INCREMENT =
    64         new String ("increment");
    65         new String ("increment");
    65 
    66 
    66 
    67 
    67     /**
    68     /**
    68      * An action which decrements a value.
    69      * An action which decrements a value.
       
    70      *
    69      * @since 1.5
    71      * @since 1.5
    70      */
    72      */
    71     public static final String DECREMENT =
    73     public static final String DECREMENT =
    72         new String ("decrement");
    74         new String ("decrement");
    73 
    75 
    74     /**
    76     /**
    75      * An action which causes a component to execute its default action.
    77      * An action which causes a component to execute its default action.
       
    78      *
    76      * @since 1.6
    79      * @since 1.6
    77      */
    80      */
    78     public static final String CLICK = new String("click");
    81     public static final String CLICK = new String("click");
    79 
    82 
    80     /**
    83     /**
    81      * An action which causes a popup to become visible if it is hidden and
    84      * An action which causes a popup to become visible if it is hidden and
    82      * hidden if it is visible.
    85      * hidden if it is visible.
       
    86      *
    83      * @since 1.6
    87      * @since 1.6
    84      */
    88      */
    85     public static final String TOGGLE_POPUP = new String("toggle popup");
    89     public static final String TOGGLE_POPUP = new String("toggle popup");
    86 
    90 
    87     /**
    91     /**
    88      * Returns the number of accessible actions available in this object
    92      * Returns the number of accessible actions available in this object If
    89      * If there are more than one, the first one is considered the "default"
    93      * there are more than one, the first one is considered the "default" action
    90      * action of the object.
    94      * of the object.
    91      *
    95      *
    92      * @return the zero-based number of Actions in this object
    96      * @return the zero-based number of actions in this object
    93      */
    97      */
    94     public int getAccessibleActionCount();
    98     public int getAccessibleActionCount();
    95 
    99 
    96     /**
   100     /**
    97      * Returns a description of the specified action of the object.
   101      * Returns a description of the specified action of the object.
    98      *
   102      *
    99      * @param i zero-based index of the actions
   103      * @param  i zero-based index of the actions
   100      * @return a String description of the action
   104      * @return a {@code String} description of the action
   101      * @see #getAccessibleActionCount
   105      * @see #getAccessibleActionCount
   102      */
   106      */
   103     public String getAccessibleActionDescription(int i);
   107     public String getAccessibleActionDescription(int i);
   104 
   108 
   105     /**
   109     /**
   106      * Performs the specified Action on the object
   110      * Performs the specified action on the object.
   107      *
   111      *
   108      * @param i zero-based index of actions
   112      * @param  i zero-based index of actions
   109      * @return true if the action was performed; otherwise false.
   113      * @return {@code true} if the action was performed; otherwise {@code false}
   110      * @see #getAccessibleActionCount
   114      * @see #getAccessibleActionCount
   111      */
   115      */
   112     public boolean doAccessibleAction(int i);
   116     public boolean doAccessibleAction(int i);
   113 }
   117 }