1. /*
  2. * @(#)AccessibleSelection.java 1.13 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.accessibility;
  8. /**
  9. * This AccessibleSelection interface
  10. * provides the standard mechanism for an assistive technology to determine
  11. * what the current selected children are, as well as modify the selection set.
  12. * Any object that has children that can be selected should support
  13. * the AccessibleSelection interface. Applications can determine if an object supports the
  14. * AccessibleSelection interface by first obtaining its AccessibleContext (see
  15. * {@link Accessible}) and then calling the
  16. * {@link AccessibleContext#getAccessibleSelection} method.
  17. * 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#getAccessibleSelection
  23. *
  24. * @version 1.7 08/26/98 21:14:11
  25. * @author Peter Korn
  26. * @author Hans Muller
  27. * @author Willie Walker
  28. */
  29. public interface AccessibleSelection {
  30. /**
  31. * Returns the number of Accessible children currently selected.
  32. * If no children are selected, the return value will be 0.
  33. *
  34. * @return the number of items currently selected.
  35. */
  36. public int getAccessibleSelectionCount();
  37. /**
  38. * Returns an Accessible representing the specified selected child
  39. * of the object. If there isn't a selection, or there are
  40. * fewer children selected than the integer passed in, the return
  41. * value will be null.
  42. * <p>Note that the index represents the i-th selected child, which
  43. * is different from the i-th child.
  44. *
  45. * @param i the zero-based index of selected children
  46. * @return the i-th selected child
  47. * @see #getAccessibleSelectionCount
  48. */
  49. public Accessible getAccessibleSelection(int i);
  50. /**
  51. * Determines if the current child of this object is selected.
  52. *
  53. * @return true if the current child of this object is selected; else false.
  54. * @param i the zero-based index of the child in this Accessible object.
  55. * @see AccessibleContext#getAccessibleChild
  56. */
  57. public boolean isAccessibleChildSelected(int i);
  58. /**
  59. * Adds the specified Accessible child of the object to the object's
  60. * selection. If the object supports multiple selections,
  61. * the specified child is added to any existing selection, otherwise
  62. * it replaces any existing selection in the object. If the
  63. * specified child is already selected, this method has no effect.
  64. *
  65. * @param i the zero-based index of the child
  66. * @see AccessibleContext#getAccessibleChild
  67. */
  68. public void addAccessibleSelection(int i);
  69. /**
  70. * Removes the specified child of the object from the object's
  71. * selection. If the specified item isn't currently selected, this
  72. * method has no effect.
  73. *
  74. * @param i the zero-based index of the child
  75. * @see AccessibleContext#getAccessibleChild
  76. */
  77. public void removeAccessibleSelection(int i);
  78. /**
  79. * Clears the selection in the object, so that no children in the
  80. * object are selected.
  81. */
  82. public void clearAccessibleSelection();
  83. /**
  84. * Causes every child of the object to be selected
  85. * if the object supports multiple selections.
  86. */
  87. public void selectAllAccessibleSelection();
  88. }