JIDE 3.5.15

com.jidesoft.plaf.basic
Class ExComboBoxPopup

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPopupMenu
                  extended by javax.swing.plaf.basic.BasicComboPopup
                      extended by com.jidesoft.plaf.basic.ExComboBoxPopup
All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, PopupMenuListener, MenuElement, ComboPopup
Direct Known Subclasses:
AquaExComboBoxPopup

public class ExComboBoxPopup
extends BasicComboPopup
implements PopupMenuListener, PropertyChangeListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicComboPopup
BasicComboPopup.InvocationKeyHandler, BasicComboPopup.InvocationMouseHandler, BasicComboPopup.InvocationMouseMotionHandler, BasicComboPopup.ItemHandler, BasicComboPopup.ListDataHandler, BasicComboPopup.ListMouseHandler, BasicComboPopup.ListMouseMotionHandler, BasicComboPopup.ListSelectionHandler, BasicComboPopup.PropertyChangeHandler
 
Nested classes/interfaces inherited from class javax.swing.JPopupMenu
JPopupMenu.AccessibleJPopupMenu, JPopupMenu.Separator
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  ExComboBox _comboBox
           
protected  StandardDialog _dialog
          The dialog that will be shown.
protected  JidePopup _popup
          The popup window that will be shown when button is pressed.
protected  PopupPanel _popupPanel
           
 LineBorder LINE_BORDER
           
 
Fields inherited from class javax.swing.plaf.basic.BasicComboPopup
autoscrollTimer, comboBox, hasEntered, isAutoScrolling, itemListener, keyListener, list, listDataListener, listMouseListener, listMouseMotionListener, listSelectionListener, mouseListener, mouseMotionListener, propertyChangeListener, SCROLL_DOWN, SCROLL_UP, scrollDirection, scroller, valueIsAdjusting
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ExComboBoxPopup(JComboBox combo)
           
 
Method Summary
protected  Point calculatePopupLocation()
          calculate the popup location.
protected  JidePopup createPopupWindow()
          Creates the popup window.
protected  void customizeDialog(JDialog dialog)
          Customizes the dialog.
protected  void customizeDialogLocation(JDialog dialog)
          Customizes the dialog location.
protected  void customizePopup(JidePopup popup)
          Customizes the JidePopup that is used to show the drop down.
protected  void customizePopupPanel(PopupPanel popupPanel)
           
protected  Action getDialogCancelAction()
          Gets the cancel button action for the dialog type ComboBox.
protected  Action getDialogOKAction()
          Gets the OK button action for the dialog type ComboBox.
 PopupPanel getPopupPanel()
           
 Dimension getPreferredSize()
           
protected  int getPreferredWidth()
           
 void hide()
          Causes the combo box to close its popup window.
 boolean isPopupVisible()
          Determines the visibility of the popup.
 boolean isVisible()
           
 void popupMenuCanceled(PopupMenuEvent e)
           
 void popupMenuWillBecomeInvisible(PopupMenuEvent e)
           
 void popupMenuWillBecomeVisible(PopupMenuEvent e)
           
 void propertyChange(PropertyChangeEvent evt)
           
 void resetPopup()
          Resets the popup.
 void setPopupVisible(boolean v)
          Sets the visibility of the popup.
 void show()
          Implementation of ComboPopup.show().
 void showPopup()
          Causes the combo box to display its popup window.
protected  void showPopupPanel()
          Shows the popup panel.
protected  void showPopupPanelAsPopup(boolean show)
           
protected  void togglePopup()
           
 
Methods inherited from class javax.swing.plaf.basic.BasicComboPopup
autoScrollDown, autoScrollUp, computePopupBounds, configureList, configurePopup, configureScroller, convertMouseEvent, createItemListener, createKeyListener, createList, createListDataListener, createListMouseListener, createListMouseMotionListener, createListSelectionListener, createMouseListener, createMouseMotionListener, createPropertyChangeListener, createScroller, delegateFocus, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getKeyListener, getList, getMouseListener, getMouseMotionListener, getPopupHeightForRowCount, installComboBoxListeners, installComboBoxModelListeners, installKeyboardActions, installListListeners, isFocusTraversable, startAutoScrolling, stopAutoScrolling, uninstallComboBoxModelListeners, uninstallingUI, uninstallKeyboardActions, updateListBoxSelectionForEvent
 
Methods inherited from class javax.swing.JPopupMenu
add, add, add, addMenuKeyListener, addPopupMenuListener, addSeparator, createActionChangeListener, createActionComponent, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getMenuKeyListeners, getPopupMenuListeners, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, menuSelectionChanged, pack, paintBorder, paramString, processFocusEvent, processKeyEvent, processKeyEvent, processMouseEvent, remove, removeMenuKeyListener, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_dialog

protected StandardDialog _dialog
The dialog that will be shown.


_popup

protected JidePopup _popup
The popup window that will be shown when button is pressed.


_popupPanel

protected PopupPanel _popupPanel

_comboBox

protected ExComboBox _comboBox

LINE_BORDER

public LineBorder LINE_BORDER
Constructor Detail

ExComboBoxPopup

public ExComboBoxPopup(JComboBox combo)
Method Detail

show

public void show()
Implementation of ComboPopup.show().

Specified by:
show in interface ComboPopup
Overrides:
show in class BasicComboPopup

showPopupPanel

protected void showPopupPanel()
Shows the popup panel. It will show popup as drop down or dialog depending on the type.


showPopupPanelAsPopup

protected void showPopupPanelAsPopup(boolean show)
Parameters:
show - the flag that if we should really show the popup panel

customizePopupPanel

protected void customizePopupPanel(PopupPanel popupPanel)

getPreferredWidth

protected int getPreferredWidth()

customizePopup

protected void customizePopup(JidePopup popup)
Customizes the JidePopup that is used to show the drop down.

Parameters:
popup - the JidePopup.

resetPopup

public void resetPopup()
Resets the popup. If the popup is not volatile, this method will reset the popup to null so next time it will recreate again.


createPopupWindow

protected JidePopup createPopupWindow()
Creates the popup window. By default it will create a JidePopup which is not detached and not resizable. Subclass can override it to create your own JidePopup or customize the default one.

Returns:
the popup window.

calculatePopupLocation

protected Point calculatePopupLocation()
calculate the popup location.

Returns:
the location of popup.

getDialogOKAction

protected Action getDialogOKAction()
Gets the OK button action for the dialog type ComboBox.

Returns:
the dialog OK action.

getDialogCancelAction

protected Action getDialogCancelAction()
Gets the cancel button action for the dialog type ComboBox.

Returns:
the dialog cancel action.

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

customizeDialogLocation

protected void customizeDialogLocation(JDialog dialog)
Customizes the dialog location. By default, we will call dialog.setLocationRelativeTo(null) so that it will locate at the center of the screen. If you want to put it relative to the AbstractComboBox itself, you can call dialog.setLocationRelativeTo(this). Or you can call setLocation to set it at any location on the screen. We will call this method after dialog.pack() is called and before dialog.setVisible(true) is called.

Parameters:
dialog - the dialog

customizeDialog

protected void customizeDialog(JDialog dialog)
Customizes the dialog. This method is called just before dialog.pack() and dialog.setVisible(true) are called. You can override it to add extra code to customize the dialog.

Parameters:
dialog - the dialog

getPopupPanel

public PopupPanel getPopupPanel()

showPopup

public void showPopup()
Causes the combo box to display its popup window.

See Also:
setPopupVisible(boolean)

hide

public void hide()
Causes the combo box to close its popup window.

Specified by:
hide in interface ComboPopup
Overrides:
hide in class BasicComboPopup
See Also:
setPopupVisible(boolean)

togglePopup

protected void togglePopup()
Overrides:
togglePopup in class BasicComboPopup

setPopupVisible

public void setPopupVisible(boolean v)
Sets the visibility of the popup.

Parameters:
v - visibility

isPopupVisible

public boolean isPopupVisible()
Determines the visibility of the popup.

Returns:
true if the popup is visible, otherwise returns false

isVisible

public boolean isVisible()
Specified by:
isVisible in interface ComboPopup
Overrides:
isVisible in class JPopupMenu

popupMenuWillBecomeVisible

public void popupMenuWillBecomeVisible(PopupMenuEvent e)
Specified by:
popupMenuWillBecomeVisible in interface PopupMenuListener

popupMenuWillBecomeInvisible

public void popupMenuWillBecomeInvisible(PopupMenuEvent e)
Specified by:
popupMenuWillBecomeInvisible in interface PopupMenuListener

popupMenuCanceled

public void popupMenuCanceled(PopupMenuEvent e)
Specified by:
popupMenuCanceled in interface PopupMenuListener

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent

JIDE 3.5.15