1. /*
  2. * @(#)ItemSelectable.java 1.16 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt;
  8. import java.awt.event.*;
  9. /**
  10. * The interface for objects which contain a set of items for
  11. * which zero or more can be selected.
  12. *
  13. * @version 1.16 12/19/03
  14. * @author Amy Fowler
  15. */
  16. public interface ItemSelectable {
  17. /**
  18. * Returns the selected items or <code>null</code> if no
  19. * items are selected.
  20. */
  21. public Object[] getSelectedObjects();
  22. /**
  23. * Adds a listener to receive item events when the state of an item is
  24. * changed by the user. Item events are not sent when an item's
  25. * state is set programmatically. If <code>l</code> is
  26. * <code>null</code>, no exception is thrown and no action is performed.
  27. *
  28. * @param l the listener to receive events
  29. * @see ItemEvent
  30. */
  31. public void addItemListener(ItemListener l);
  32. /**
  33. * Removes an item listener.
  34. * If <code>l</code> is <code>null</code>,
  35. * no exception is thrown and no action is performed.
  36. *
  37. * @param l the listener being removed
  38. * @see ItemEvent
  39. */
  40. public void removeItemListener(ItemListener l);
  41. }