Package Summary  Overview Summary

class:BasicComboPopup [NONE]

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible, MenuElement, ComboPopup
    Direct Known Subclasses:
    MetalComboBoxUI.MetalComboPopup

    public class BasicComboPopup
    extends JPopupMenu
    implements ComboPopup
    
    This is a basic implementation of the 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 XMLEncoder.

    See Also:
    Serialized Form

field:comboBox [NONE]

  • comboBox

    protected JComboBox<Object> comboBox
    The instance of JComboBox.

field:list [NONE]

  • list

    protected JList<Object> list
    This protected field is implementation specific. Do not access directly or override. Use the accessor methods instead.
    See Also:
    getList(), createList()

field:scroller [NONE]

  • scroller

    protected JScrollPane scroller
    This protected field is implementation specific. Do not access directly or override. Use the create method instead
    See Also:
    createScroller()

field:valueIsAdjusting [NONE]

  • valueIsAdjusting

    protected boolean valueIsAdjusting
    As of Java 2 platform v1.4 this previously undocumented field is no longer used.

field:mouseMotionListener [NONE]

field:mouseListener [NONE]

field:keyListener [NONE]

field:listSelectionListener [NONE]

field:listMouseListener [NONE]

  • listMouseListener

    protected MouseListener listMouseListener
    This protected field is implementation specific. Do not access directly or override. Use the create method instead.
    See Also:
    createListMouseListener()

field:listMouseMotionListener [NONE]

field:propertyChangeListener [NONE]

field:listDataListener [NONE]

  • listDataListener

    protected ListDataListener listDataListener
    This protected field is implementation specific. Do not access directly or override. Use the create method instead
    See Also:
    createListDataListener()

field:itemListener [NONE]

  • itemListener

    protected ItemListener itemListener
    This protected field is implementation specific. Do not access directly or override. Use the create method instead
    See Also:
    createItemListener()

field:autoscrollTimer [NONE]

  • autoscrollTimer

    protected Timer autoscrollTimer
    This protected field is implementation specific. Do not access directly or override.

field:hasEntered [NONE]

  • hasEntered

    protected boolean hasEntered
    true if the mouse cursor is in the popup.

field:isAutoScrolling [NONE]

  • isAutoScrolling

    protected boolean isAutoScrolling
    If true the auto-scrolling is enabled.

field:scrollDirection [NONE]

  • scrollDirection

    protected int scrollDirection
    The direction of scrolling.

field:SCROLL_UP [NONE]

  • SCROLL_UP

    protected static final int SCROLL_UP
    The direction of scrolling up.
    See Also:
    Constant Field Values

field:SCROLL_DOWN [NONE]

  • SCROLL_DOWN

    protected static final int SCROLL_DOWN
    The direction of scrolling down.
    See Also:
    Constant Field Values

constructor:<init>(javax.swing.JComboBox) [NONE]

  • BasicComboPopup

    public BasicComboPopup​(JComboBox<Object> combo)
    Constructs a new instance of BasicComboPopup.
    Parameters:
    combo - an instance of JComboBox

method:show() [NONE]

  • show

    public void show()
    Implementation of ComboPopup.show().
    Specified by:
    show in interface ComboPopup
    Overrides:
    show in class Component

method:hide() [NONE]

  • hide

    public void hide()
    Implementation of ComboPopup.hide().
    Specified by:
    hide in interface ComboPopup
    Overrides:
    hide in class JComponent

method:getList() [NONE]

  • getList

    public JList<Object> getList()
    Implementation of ComboPopup.getList().
    Specified by:
    getList in interface ComboPopup
    Returns:
    the list that is being used to draw the items in the combo box

method:getMouseListener() [NONE]

method:getMouseMotionListener() [NONE]

method:getKeyListener() [NONE]

method:uninstallingUI() [NONE]

  • uninstallingUI

    public void uninstallingUI()
    Called when the UI is uninstalling. Since this popup isn't in the component tree, it won't get it's uninstallUI() called. It removes the listeners that were added in addComboBoxListeners().
    Specified by:
    uninstallingUI in interface ComboPopup

method:uninstallComboBoxModelListeners(javax.swing.ComboBoxModel) [NONE]

method:uninstallKeyboardActions() [NONE]

  • uninstallKeyboardActions

    protected void uninstallKeyboardActions()
    Unregisters keyboard actions.

method:firePopupMenuWillBecomeVisible() [NONE]

  • firePopupMenuWillBecomeVisible

    protected void firePopupMenuWillBecomeVisible()
    Description copied from class: JPopupMenu
    Notifies PopupMenuListeners that this popup menu will become visible.
    Overrides:
    firePopupMenuWillBecomeVisible in class JPopupMenu

method:firePopupMenuWillBecomeInvisible() [NONE]

  • firePopupMenuWillBecomeInvisible

    protected void firePopupMenuWillBecomeInvisible()
    Description copied from class: JPopupMenu
    Notifies PopupMenuListeners that this popup menu will become invisible.
    Overrides:
    firePopupMenuWillBecomeInvisible in class JPopupMenu

method:firePopupMenuCanceled() [NONE]

  • firePopupMenuCanceled

    protected void firePopupMenuCanceled()
    Description copied from class: JPopupMenu
    Notifies PopupMenuListeners that this popup menu is cancelled.
    Overrides:
    firePopupMenuCanceled in class JPopupMenu

method:createMouseListener() [NONE]

  • createMouseListener

    protected MouseListener createMouseListener()
    Creates 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.
    Returns:
    a MouseListener which will be added to the combo box or null

method:createMouseMotionListener() [NONE]

  • createMouseMotionListener

    protected MouseMotionListener createMouseMotionListener()
    Creates the mouse motion listener which will be added to the combo box. Warning: When overriding this method, make sure to maintain the existing behavior.
    Returns:
    a MouseMotionListener which will be added to the combo box or null

method:createKeyListener() [NONE]

  • createKeyListener

    protected KeyListener createKeyListener()
    Creates the key listener that will be added to the combo box. If this method returns null then it will not be added to the combo box.
    Returns:
    a KeyListener or null

method:createListSelectionListener() [NONE]

  • createListSelectionListener

    protected ListSelectionListener createListSelectionListener()
    Creates a list selection listener that watches for selection changes in the popup's list. If this method returns null then it will not be added to the popup list.
    Returns:
    an instance of a ListSelectionListener or null

method:createListDataListener() [NONE]

  • createListDataListener

    protected ListDataListener createListDataListener()
    Creates a list data listener which will be added to the ComboBoxModel. If this method returns null then it will not be added to the combo box model.
    Returns:
    an instance of a ListDataListener or null

method:createListMouseListener() [NONE]

  • createListMouseListener

    protected MouseListener createListMouseListener()
    Creates a mouse listener that watches for mouse events in the popup's list. If this method returns null then it will not be added to the combo box.
    Returns:
    an instance of a MouseListener or null

method:createListMouseMotionListener() [NONE]

  • createListMouseMotionListener

    protected MouseMotionListener createListMouseMotionListener()
    Creates a mouse motion listener that watches for mouse motion events in the popup's list. If this method returns null then it will not be added to the combo box.
    Returns:
    an instance of a MouseMotionListener or null

method:createPropertyChangeListener() [NONE]

  • createPropertyChangeListener

    protected PropertyChangeListener createPropertyChangeListener()
    Creates a PropertyChangeListener which will be added to the combo box. If this method returns null then it will not be added to the combo box.
    Returns:
    an instance of a PropertyChangeListener or null

method:createItemListener() [NONE]

  • createItemListener

    protected ItemListener createItemListener()
    Creates an ItemListener which will be added to the combo box. If this method returns null then it will not be added to the combo box.

    Subclasses may override this method to return instances of their own ItemEvent handlers.

    Returns:
    an instance of an ItemListener or null

method:createList() [NONE]

  • createList

    protected JList<Object> createList()
    Creates the JList used in the popup to display the items in the combo box model. This method is called when the UI class is created.
    Returns:
    a JList used to display the combo box items

method:configureList() [NONE]

  • configureList

    protected void configureList()
    Configures the list which is used to hold the combo box items in the popup. This method is called when the UI class is created.
    See Also:
    createList()

method:installListListeners() [NONE]

  • installListListeners

    protected void installListListeners()
    Adds the listeners to the list control.

method:createScroller() [NONE]

  • createScroller

    protected JScrollPane createScroller()
    Creates the scroll pane which houses the scrollable list.
    Returns:
    the scroll pane which houses the scrollable list

method:configureScroller() [NONE]

  • configureScroller

    protected void configureScroller()
    Configures the scrollable portion which holds the list within the combo box popup. This method is called when the UI class is created.

method:configurePopup() [NONE]

  • configurePopup

    protected void configurePopup()
    Configures the popup portion of the combo box. This method is called when the UI class is created.

method:installComboBoxListeners() [NONE]

  • installComboBoxListeners

    protected void installComboBoxListeners()
    This method adds the necessary listeners to the JComboBox.

method:installComboBoxModelListeners(javax.swing.ComboBoxModel) [NONE]

  • installComboBoxModelListeners

    protected void installComboBoxModelListeners​(ComboBoxModel<?> model)
    Installs the listeners on the combo box model. Any listeners installed on the combo box model should be removed in uninstallComboBoxModelListeners.
    Parameters:
    model - The combo box model to install listeners
    See Also:
    uninstallComboBoxModelListeners(javax.swing.ComboBoxModel<?>)

method:installKeyboardActions() [NONE]

  • installKeyboardActions

    protected void installKeyboardActions()
    Registers keyboard actions.

method:isFocusTraversable() [NONE]

method:startAutoScrolling(int) [NONE]

  • startAutoScrolling

    protected void startAutoScrolling​(int direction)
    This protected method is implementation specific and should be private. do not call or override.
    Parameters:
    direction - the direction of scrolling

method:stopAutoScrolling() [NONE]

  • stopAutoScrolling

    protected void stopAutoScrolling()
    This protected method is implementation specific and should be private. do not call or override.

method:autoScrollUp() [NONE]

  • autoScrollUp

    protected void autoScrollUp()
    This protected method is implementation specific and should be private. do not call or override.

method:autoScrollDown() [NONE]

  • autoScrollDown

    protected void autoScrollDown()
    This protected method is implementation specific and should be private. do not call or override.

method:getAccessibleContext() [NONE]

method:delegateFocus(java.awt.event.MouseEvent) [NONE]

  • delegateFocus

    protected void delegateFocus​(MouseEvent e)
    This is a utility method that helps event handlers figure out where to send the focus when the popup is brought up. The standard implementation delegates the focus to the editor (if the combo box is editable) or to the JComboBox if it is not editable.
    Parameters:
    e - a mouse event

method:togglePopup() [NONE]

  • togglePopup

    protected void togglePopup()
    Makes the popup visible if it is hidden and makes it hidden if it is visible.

method:convertMouseEvent(java.awt.event.MouseEvent) [NONE]

  • convertMouseEvent

    protected MouseEvent convertMouseEvent​(MouseEvent e)
    Converts mouse event.
    Parameters:
    e - a mouse event
    Returns:
    converted mouse event

method:getPopupHeightForRowCount(int) [NONE]

  • getPopupHeightForRowCount

    protected int getPopupHeightForRowCount​(int maxRowCount)
    Retrieves the height of the popup based on the current ListCellRenderer and the maximum row count.
    Parameters:
    maxRowCount - the row count
    Returns:
    the height of the popup

method:computePopupBounds(int,int,int,int) [NONE]

  • computePopupBounds

    protected Rectangle computePopupBounds​(int px,
                                           int py,
                                           int pw,
                                           int 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. If no transformations are required, then the returned rectangle will have the same values as the parameters.
    Parameters:
    px - starting x location
    py - starting y location
    pw - starting width
    ph - starting height
    Returns:
    a rectangle which represents the placement and size of the popup

method:updateListBoxSelectionForEvent(java.awt.event.MouseEvent,boolean) [NONE]

  • updateListBoxSelectionForEvent

    protected void updateListBoxSelectionForEvent​(MouseEvent anEvent,
                                                  boolean shouldScroll)
    A utility method used by the event listeners. Given a mouse event, it changes the list selection to the list item below the mouse.
    Parameters:
    anEvent - a mouse event
    shouldScroll - if true list should be scrolled.

© 2018 Oracle Corporation and/or its affiliates