public class PlasticComboBoxUI
extends javax.swing.plaf.metal.MetalComboBoxUI
ComboBoxUI.
Has the same height as text fields - unless you change the renderer.Also, this class offers to use the combo's popup prototype display value to compute the popup menu width. This is an optional feature of the JGoodies Plastic L&fs implemented via a client property key.
Options.COMBO_POPUP_PROTOTYPE_DISPLAY_VALUE_KEY| Modifier and Type | Class and Description |
|---|---|
private class |
PlasticComboBoxUI.PlasticComboBoxLayoutManager
This layout manager handles the 'standard' layout of combo boxes.
|
private static class |
PlasticComboBoxUI.PlasticComboPopup
Differs from the BasicComboPopup in that it uses the standard
popmenu border and honors an optional popup prototype display value.
|
private class |
PlasticComboBoxUI.PlasticPropertyChangeListener
Overriden to use PlasticComboBoxButton instead of a MetalComboBoxButton.
|
private class |
PlasticComboBoxUI.TableCellEditorPropertyChangeHandler
Listens to changes in the table cell editor client property
and updates the default editor - if any - to use the correct
insets for this case.
|
javax.swing.plaf.metal.MetalComboBoxUI.MetalComboBoxLayoutManager, javax.swing.plaf.metal.MetalComboBoxUI.MetalComboPopup, javax.swing.plaf.metal.MetalComboBoxUI.MetalPropertyChangeListenerjavax.swing.plaf.basic.BasicComboBoxUI.ComboBoxLayoutManager, javax.swing.plaf.basic.BasicComboBoxUI.FocusHandler, javax.swing.plaf.basic.BasicComboBoxUI.ItemHandler, javax.swing.plaf.basic.BasicComboBoxUI.KeyHandler, javax.swing.plaf.basic.BasicComboBoxUI.ListDataHandler, javax.swing.plaf.basic.BasicComboBoxUI.PropertyChangeHandler| Modifier and Type | Field and Description |
|---|---|
(package private) static java.lang.String |
CELL_EDITOR_KEY |
private static javax.swing.JTextField |
PHANTOM
Used to determine the minimum height of a text field,
which in turn is used to answer the combobox's minimum height.
|
private static java.lang.Class |
phantomLafClass
Different Plastic L&fs may need different phantom UIs.
|
private java.beans.PropertyChangeListener |
propertyChangeListener |
private boolean |
tableCellEditor |
arrowButton, cachedMinimumSize, comboBox, currentValuePane, editor, focusListener, hasFocus, isMinimumSizeDirty, itemListener, keyListener, listBox, listDataListener, padding, popup, popupKeyListener, popupMouseListener, popupMouseMotionListener, squareButton| Constructor and Description |
|---|
PlasticComboBoxUI() |
| Modifier and Type | Method and Description |
|---|---|
protected javax.swing.JButton |
createArrowButton()
Creates and answers the arrow button that is to be used in the combo box.
|
protected javax.swing.ComboBoxEditor |
createEditor()
Creates the editor that is to be used in editable combo boxes.
|
protected java.awt.LayoutManager |
createLayoutManager()
Creates a layout manager for managing the components which
make up the combo box.
|
protected javax.swing.plaf.basic.ComboPopup |
createPopup() |
java.beans.PropertyChangeListener |
createPropertyChangeListener() |
protected javax.swing.ListCellRenderer |
createRenderer()
Creates the default renderer that will be used in a non-editiable combo
box.
|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent b) |
private static void |
ensurePhantomHasPlasticUI()
Ensures that the phantom text field has a Plastic text field UI.
|
(package private) static int |
getEditableButtonWidth()
Computes and returns the width of the arrow button in editable state.
|
java.awt.Dimension |
getMinimumSize(javax.swing.JComponent c)
The minumum size is the size of the display area plus insets plus the button.
|
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c)
Delegates to #getMinimumSize(Component).
|
protected void |
installListeners() |
void |
installUI(javax.swing.JComponent c) |
private boolean |
isTableCellEditor()
Checks and answers if this UI's combo has a client property
that indicates that the combo is used as a table cell editor.
|
protected boolean |
isToolBarComboBox(javax.swing.JComponent c)
Checks and answers if this combo is in a tool bar.
|
protected java.awt.Rectangle |
rectangleForCurrentValue()
Returns the area that is reserved for drawing the currently selected item.
|
protected void |
uninstallListeners() |
void |
update(java.awt.Graphics g,
javax.swing.JComponent c) |
configureEditor, editablePropertyChanged, getBaseline, layoutComboBox, paint, paintCurrentValue, paintCurrentValueBackground, removeListeners, unconfigureEditoraddEditor, configureArrowButton, createFocusListener, createItemListener, createKeyListener, createListDataListener, getAccessibleChild, getAccessibleChildrenCount, getBaselineResizeBehavior, getDefaultSize, getDisplaySize, getInsets, getMaximumSize, getSizeForComponent, installComponents, installDefaults, installKeyboardActions, isFocusTraversable, isNavigationKey, isPopupVisible, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallUIstatic final java.lang.String CELL_EDITOR_KEY
private static final javax.swing.JTextField PHANTOM
private static java.lang.Class phantomLafClass
private boolean tableCellEditor
private java.beans.PropertyChangeListener propertyChangeListener
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent b)
private static void ensurePhantomHasPlasticUI()
public void installUI(javax.swing.JComponent c)
installUI in class javax.swing.plaf.basic.BasicComboBoxUIprotected void installListeners()
installListeners in class javax.swing.plaf.basic.BasicComboBoxUIprotected void uninstallListeners()
uninstallListeners in class javax.swing.plaf.basic.BasicComboBoxUIprotected javax.swing.JButton createArrowButton()
Overridden to use a button that can have a pseudo 3D effect.
createArrowButton in class javax.swing.plaf.metal.MetalComboBoxUIprotected javax.swing.ComboBoxEditor createEditor()
createEditor in class javax.swing.plaf.metal.MetalComboBoxUIprotected java.awt.LayoutManager createLayoutManager()
Overriden to use a layout that has a fixed width arrow button.
createLayoutManager in class javax.swing.plaf.metal.MetalComboBoxUIprotected javax.swing.plaf.basic.ComboPopup createPopup()
createPopup in class javax.swing.plaf.metal.MetalComboBoxUIprotected javax.swing.ListCellRenderer createRenderer()
setRenderer.This method differs from the superclass implementation in that it uses an empty border with wider left and right margins of 2 pixels instead of 1.
createRenderer in class javax.swing.plaf.basic.BasicComboBoxUIListCellRender used for the combo boxJComboBox.setRenderer(javax.swing.ListCellRenderer<? super E>)public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
getMinimumSize in class javax.swing.plaf.metal.MetalComboBoxUIpublic java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
getPreferredSize in class javax.swing.plaf.basic.BasicComboBoxUIprotected java.awt.Rectangle rectangleForCurrentValue()
rectangleForCurrentValue in class javax.swing.plaf.basic.BasicComboBoxUIpublic void update(java.awt.Graphics g,
javax.swing.JComponent c)
update in class javax.swing.plaf.ComponentUIprotected boolean isToolBarComboBox(javax.swing.JComponent c)
c - the component to checkstatic int getEditableButtonWidth()
private boolean isTableCellEditor()
true if the table cell editor client property
is set to Boolean.TRUE, false otherwisepublic java.beans.PropertyChangeListener createPropertyChangeListener()
createPropertyChangeListener in class javax.swing.plaf.metal.MetalComboBoxUI