ComboPopup interface.
This class represents the ui for the popup portion of the combo box.
All event handling is handled by listener classes created with the
createxxxListener() methods and internal classes.
You can change the behavior of this class by overriding the
createxxxListener() methods and supplying your own
event listeners or subclassing from the ones supplied in this class.
Warning
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see java..
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class | |
| private class | |
| public class | BasicComboPopup.
As of Java 2 platform v 1.4, this class is now obsolete and is only included for backwards API compatibility. |
| protected class | BasicComboPopup.
A listener to be registered upon the combo box (not its popup menu) to handle mouse events that affect the state of the popup menu. |
| protected class | BasicComboPopup.
This listener watches for dragging and updates the current selection in the list if it is dragging over the list. |
| protected class | BasicComboPopup.
This listener watches for changes to the selection in the combo box. |
| public class | BasicComboPopup.
As of 1.4, this class is now obsolete, doesn't do anything, and is only included for backwards API compatibility. |
| protected class | BasicComboPopup.
This listener hides the popup when the mouse is released in the list. |
| protected class | BasicComboPopup.
This listener changes the selected item as you move the mouse over the list. |
| protected class | BasicComboPopup.
As of Java 2 platform v 1.4, this class is now obsolete, doesn't do anything, and is only included for backwards API compatibility. |
| protected class | BasicComboPopup.
This listener watches for bound properties that have changed in the combo box. |
| Modifier and Type | Field and Description |
|---|---|
| protected Timer | autoscrollTimer
This protected field is implementation specific. |
| protected JComboBox | comboBox
The instance of |
| pack-priv static final ListModel | |
| private BasicComboPopup. | handler
Implementation of all the listener classes. |
| protected boolean | hasEntered
|
| protected boolean | isAutoScrolling
If |
| protected ItemListener | itemListener
This protected field is implementation specific. |
| protected KeyListener | keyListener
This protected field is implementation specific.
|
| protected JList | list
This protected field is implementation specific. |
| private static Border | |
| protected ListDataListener | listDataListener
This protected field is implementation specific. |
| protected MouseListener | listMouseListener
This protected field is implementation specific. |
| protected MouseMotionListener | listMouseMotionListener
This protected field is implementation specific. |
| protected ListSelectionListener | listSelectionListener
This protected field is implementation specific. |
| protected MouseListener | mouseListener
This protected field is implementation specific.
|
| protected MouseMotionListener | mouseMotionListener
This protected field is implementation specific.
|
| protected PropertyChangeListener | propertyChangeListener
This protected field is implementation specific. |
| protected static final int | SCROLL_DOWN
The direction of scrolling down. |
| protected static final int | SCROLL_UP
The direction of scrolling up. |
| protected int | scrollDirection
The direction of scrolling. |
| protected JScrollPane | scroller
This protected field is implementation specific. |
| private MouseWheelListener | |
| protected boolean | valueIsAdjusting
As of Java 2 platform v1.4 this previously undocumented field is no longer used. |
| Access | Constructor and Description |
|---|---|
| public | BasicComboPopup(JComboBox<Object>
an instance of combo)JComboBoxConstructs a new instance of |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | |
| protected Rectangle | Returns: a rectangle which represents the placement and size of the popupstarting x location px, int starting y location py, int starting width pw, int starting height ph)Calculate the placement and size of the popup portion of the combo box based on the combo box location and the enclosing screen bounds. |
| protected void | |
| protected void | |
| protected void | configureScroller()
Configures the scrollable portion which holds the list within the combo box popup. |
| protected MouseEvent | |
| protected ItemListener | Returns: an instance of anItemListener or nullCreates an |
| protected KeyListener | Returns: aKeyListener or nullCreates the key listener that will be added to the combo box. |
| protected JList | Returns: aJList used to display the combo box itemsCreates the JList used in the popup to display the items in the combo box model. |
| protected ListDataListener | Returns: an instance of aListDataListener or nullCreates a list data listener which will be added to the
|
| protected MouseListener | Returns: an instance of aMouseListener or nullCreates a mouse listener that watches for mouse events in the popup's list. |
| protected MouseMotionListener | Returns: an instance of aMouseMotionListener or nullCreates a mouse motion listener that watches for mouse motion events in the popup's list. |
| protected ListSelectionListener | Returns: an instance of aListSelectionListener or nullCreates a list selection listener that watches for selection changes in the popup's list. |
| protected MouseListener | Returns: aMouseListener which will be added to
the combo box or nullCreates a listener that will watch for mouse-press and release events on the combo box Warning When overriding this method, make sure to maintain the existing behavior. |
| protected MouseMotionListener | Returns: aMouseMotionListener which will be added to
the combo box or nullCreates the mouse motion listener which will be added to the combo box Warning When overriding this method, make sure to maintain the existing behavior. |
| protected PropertyChangeListener | Returns: an instance of aPropertyChangeListener or nullCreates a |
| protected JScrollPane | Returns: the scroll pane which houses the scrollable listCreates the scroll pane which houses the scrollable list. |
| protected void | delegateFocus(MouseEvent
a mouse event e)This is a utility method that helps event handlers figure out where to send the focus when the popup is brought up. |
| protected void | firePopupMenuCanceled()
Overrides javax. Notifies |
| protected void | firePopupMenuWillBecomeInvisible()
Overrides javax. Notifies |
| protected void | firePopupMenuWillBecomeVisible()
Overrides javax. Notifies |
| public AccessibleContext | Returns: an AccessibleContext for the BasicComboPopupOverrides javax. Implements javax. Gets the AccessibleContext associated with this BasicComboPopup. |
| private BasicComboPopup. | |
| public KeyListener | Returns: aKeyListener or nullImplements javax. Implementation of ComboPopup.getKeyListener(). |
| public JList | getList()
Implements javax. Implementation of ComboPopup.getList(). |
| public MouseListener | Returns: aMouseListener or nullImplements javax. Implementation of ComboPopup.getMouseListener(). |
| public MouseMotionListener | Returns: aMouseMotionListener or nullImplements javax. Implementation of ComboPopup.getMouseMotionListener(). |
| protected int | Returns: the height of the popupthe row count maxRowCount)Retrieves the height of the popup based on the current ListCellRenderer and the maximum row count. |
| private Point | |
| public void | hide()
Overrides javax. Implements javax. Implementation of ComboPopup.hide(). |
| protected void | |
| protected void | installComboBoxModelListeners(ComboBoxModel<?>
The combo box model to install listeners model)Installs the listeners on the combo box model. |
| protected void | |
| protected void | |
| private void | |
| public boolean | isFocusTraversable()
Overrides java. Overridden to unconditionally return false. |
| private void | setListSelection(int
the index to set the list selectedIndex)Sets the list selection index to the selectedIndex. |
| public void | show()
Overrides java. Implements javax. Implementation of ComboPopup.show(). |
| protected void | startAutoScrolling(int
the direction of scrolling direction)This protected method is implementation specific and should be private. |
| protected void | |
| protected void | |
| protected void | uninstallComboBoxModelListeners(ComboBoxModel<?>
The combo box model to install listeners model)Removes the listeners from the combo box model |
| public void | uninstallingUI()
Implements javax. Called when the UI is uninstalling. |
| protected void | |
| pack-priv void | |
| private void | |
| protected void | updateListBoxSelectionForEvent(MouseEvent
a mouse event anEvent, boolean if shouldScroll)true list should be scrolled.A utility method used by the event listeners. |