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. package javax.accessibility;
  8. /**
  9. * The AccessibleAction interface should be supported by any object
  10. * that can perform one or more actions. This interface
  11. * provides the standard mechanism for an assistive technology to determine
  12. * what those actions are as well as tell the object to perform them.
  13. * Any object that can be manipulated should support this
  14. * interface. Applications can determine if an object supports the
  15. * AccessibleAction interface by first obtaining its AccessibleContext (see
  16. * {@link Accessible}) and then calling the {@link AccessibleContext#getAccessibleAction}
  17. * method. If the return value is not null, the object supports this interface.
  18. *
  19. * @see Accessible
  20. * @see Accessible#getAccessibleContext
  21. * @see AccessibleContext
  22. * @see AccessibleContext#getAccessibleAction
  23. *
  24. * @version 1.17 04/15/04
  25. * @author Peter Korn
  26. * @author Hans Muller
  27. * @author Willie Walker
  28. * @author Lynn Monsanto
  29. */
  30. public interface AccessibleAction {
  31. /**
  32. * An action which causes a tree node to
  33. * collapse if expanded and expand if collapsed.
  34. * @since 1.5
  35. */
  36. public static final String TOGGLE_EXPAND =
  37. new String ("toggle expand");
  38. /**
  39. * An action which increments a value.
  40. * @since 1.5
  41. */
  42. public static final String INCREMENT =
  43. new String ("increment");
  44. /**
  45. * An action which decrements a value.
  46. * @since 1.5
  47. */
  48. public static final String DECREMENT =
  49. new String ("decrement");
  50. /**
  51. * Returns the number of accessible actions available in this object
  52. * If there are more than one, the first one is considered the "default"
  53. * action of the object.
  54. *
  55. * @return the zero-based number of Actions in this object
  56. */
  57. public int getAccessibleActionCount();
  58. /**
  59. * Returns a description of the specified action of the object.
  60. *
  61. * @param i zero-based index of the actions
  62. * @return a String description of the action
  63. * @see #getAccessibleActionCount
  64. */
  65. public String getAccessibleActionDescription(int i);
  66. /**
  67. * Performs the specified Action on the object
  68. *
  69. * @param i zero-based index of actions
  70. * @return true if the action was performed; otherwise false.
  71. * @see #getAccessibleActionCount
  72. */
  73. public boolean doAccessibleAction(int i);
  74. }