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