1. /*
  2. * @(#)ItemSelectable.java 1.10 01/11/29
  3. *
  4. * Copyright 2002 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.10 11/29/01
  14. * @author Amy Fowler
  15. */
  16. public interface ItemSelectable {
  17. /**
  18. * Returns the selected items or null if no items are selected.
  19. */
  20. public Object[] getSelectedObjects();
  21. /**
  22. * Add a listener to recieve item events when the state of
  23. * an item changes.
  24. * If l is null, no exception is thrown and no action is performed.
  25. *
  26. * @param l the listener to recieve events
  27. * @see ItemEvent
  28. */
  29. public void addItemListener(ItemListener l);
  30. /**
  31. * Removes an item listener.
  32. * If l is null, no exception is thrown and no action is performed.
  33. *
  34. * @param l the listener being removed
  35. * @see ItemEvent
  36. */
  37. public void removeItemListener(ItemListener l);
  38. }