1. /*
  2. * @(#)ComboBoxModel.java 1.14 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.swing;
  8. /**
  9. * A data model for a combo box. This interface extends <code>ListDataModel</code>
  10. * and adds the concept of a <i>selected item</i>. The selected item is generally
  11. * the item which is visible in the combo box display area.
  12. * <p>
  13. * The selected item may not necessarily be managed by the underlying
  14. * <code>ListModel</code>. This disjoint behavior allows for the temporary
  15. * storage and retrieval of a selected item in the model.
  16. *
  17. * @version 1.14 01/23/03
  18. * @author Arnaud Weber
  19. */
  20. public interface ComboBoxModel extends ListModel {
  21. /**
  22. * Set the selected item. The implementation of this method should notify
  23. * all registered <code>ListDataListener</code>s that the contents
  24. * have changed.
  25. *
  26. * @param anItem the list object to select or <code>null</code>
  27. * to clear the selection
  28. */
  29. void setSelectedItem(Object anItem);
  30. /**
  31. * Returns the selected item
  32. * @return The selected item or <code>null</code> if there is no selection
  33. */
  34. Object getSelectedItem();
  35. }