1. /*
  2. * @(#)ComboPopup.java 1.8 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 javax.swing.plaf.basic;
  8. import java.awt.event.MouseListener;
  9. import java.awt.event.MouseMotionListener;
  10. import java.awt.event.KeyListener;
  11. import javax.swing.JList;
  12. /**
  13. * The interface which defines the kind of popup menu that BasicComboBoxUI requires.
  14. * Classes that implement this interface don't have to extend JPopupMenu. This interface
  15. * demands very little so alternatives to JPopupMenu can be used.
  16. * <p>
  17. * <strong>Warning:</strong>
  18. * Serialized objects of this class will not be compatible with
  19. * future Swing releases. The current serialization support is appropriate
  20. * for short term storage or RMI between applications running the same
  21. * version of Swing. A future release of Swing will provide support for
  22. * long term persistence.
  23. *
  24. * @version 1.8 11/29/01
  25. * @author Tom Santos
  26. */
  27. public interface ComboPopup {
  28. /**
  29. * Shows the popup
  30. */
  31. public void show();
  32. /**
  33. * Hides the popup
  34. */
  35. public void hide();
  36. /**
  37. * Returns whether or not the popup is visible
  38. */
  39. public boolean isVisible();
  40. /**
  41. * Returns the list that is being used to draw the items in the JComboBox.
  42. */
  43. public JList getList();
  44. /**
  45. * Returns a mouse listener that shows and hides the popup.
  46. */
  47. public MouseListener getMouseListener();
  48. /**
  49. * Returns a mouse motion listener that makes the popup act like a menu.
  50. */
  51. public MouseMotionListener getMouseMotionListener();
  52. /**
  53. * Returns a key listener that shows and hides the popup.
  54. */
  55. public KeyListener getKeyListener();
  56. /**
  57. * Called to inform the ComboPopup that the UI is uninstalling.
  58. * If the ComboPopup added any listeners in the component, it should remove them here.
  59. */
  60. public void uninstallingUI();
  61. }