KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > accessibility > AccessibleAction


1 /*
2  * @(#)AccessibleAction.java 1.17 04/04/15
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.accessibility;
9
10 /**
11  * The AccessibleAction interface should be supported by any object
12  * that can perform one or more actions. This interface
13  * provides the standard mechanism for an assistive technology to determine
14  * what those actions are as well as tell the object to perform them.
15  * Any object that can be manipulated should support this
16  * interface. Applications can determine if an object supports the
17  * AccessibleAction interface by first obtaining its AccessibleContext (see
18  * {@link Accessible}) and then calling the {@link AccessibleContext#getAccessibleAction}
19  * method. If the return value is not null, the object supports this interface.
20  *
21  * @see Accessible
22  * @see Accessible#getAccessibleContext
23  * @see AccessibleContext
24  * @see AccessibleContext#getAccessibleAction
25  *
26  * @version 1.17 04/15/04
27  * @author Peter Korn
28  * @author Hans Muller
29  * @author Willie Walker
30  * @author Lynn Monsanto
31  */

32 public interface AccessibleAction {
33
34     /**
35      * An action which causes a tree node to
36      * collapse if expanded and expand if collapsed.
37      * @since 1.5
38      */

39     public static final String JavaDoc TOGGLE_EXPAND =
40         new String JavaDoc ("toggle expand");
41
42     /**
43      * An action which increments a value.
44      * @since 1.5
45      */

46     public static final String JavaDoc INCREMENT =
47         new String JavaDoc ("increment");
48
49
50     /**
51      * An action which decrements a value.
52      * @since 1.5
53      */

54     public static final String JavaDoc DECREMENT =
55         new String JavaDoc ("decrement");
56
57     /**
58      * Returns the number of accessible actions available in this object
59      * If there are more than one, the first one is considered the "default"
60      * action of the object.
61      *
62      * @return the zero-based number of Actions in this object
63      */

64     public int getAccessibleActionCount();
65
66     /**
67      * Returns a description of the specified action of the object.
68      *
69      * @param i zero-based index of the actions
70      * @return a String description of the action
71      * @see #getAccessibleActionCount
72      */

73     public String JavaDoc getAccessibleActionDescription(int i);
74
75     /**
76      * Performs the specified Action on the object
77      *
78      * @param i zero-based index of actions
79      * @return true if the action was performed; otherwise false.
80      * @see #getAccessibleActionCount
81      */

82     public boolean doAccessibleAction(int i);
83 }
84
Popular Tags