src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java

Print this page

        

*** 52,67 **** public class MetalComboBoxButton extends JButton { /** * The instance of {@code JComboBox}. */ ! protected JComboBox comboBox; /** * The instance of {@code JList}. */ ! protected JList listBox; /** * The instance of {@code CellRendererPane}. */ protected CellRendererPane rendererPane; --- 52,67 ---- public class MetalComboBoxButton extends JButton { /** * The instance of {@code JComboBox}. */ ! protected JComboBox<Object> comboBox; /** * The instance of {@code JList}. */ ! protected JList<Object> listBox; /** * The instance of {@code CellRendererPane}. */ protected CellRendererPane rendererPane;
*** 79,96 **** /** * Returns the {@code JComboBox}. * * @return the {@code JComboBox} */ ! public final JComboBox getComboBox() { return comboBox;} /** * Sets the {@code JComboBox}. * * @param cb the {@code JComboBox} */ ! public final void setComboBox( JComboBox cb ) { comboBox = cb;} /** * Returns the icon of the {@code JComboBox}. * * @return the icon of the {@code JComboBox} --- 79,96 ---- /** * Returns the {@code JComboBox}. * * @return the {@code JComboBox} */ ! public final JComboBox<Object> getComboBox() { return comboBox;} /** * Sets the {@code JComboBox}. * * @param cb the {@code JComboBox} */ ! public final void setComboBox( JComboBox<Object> cb ) { comboBox = cb;} /** * Returns the icon of the {@code JComboBox}. * * @return the icon of the {@code JComboBox}
*** 134,145 **** * @param cb an instance of {@code JComboBox} * @param i an icon * @param pane an instance of {@code CellRendererPane} * @param list an instance of {@code JList} */ ! public MetalComboBoxButton( JComboBox cb, Icon i, ! CellRendererPane pane, JList list ) { this(); comboBox = cb; comboIcon = i; rendererPane = pane; listBox = list; --- 134,145 ---- * @param cb an instance of {@code JComboBox} * @param i an icon * @param pane an instance of {@code CellRendererPane} * @param list an instance of {@code JList} */ ! public MetalComboBoxButton( JComboBox<Object> cb, Icon i, ! CellRendererPane pane, JList<Object> list ) { this(); comboBox = cb; comboIcon = i; rendererPane = pane; listBox = list;
*** 153,164 **** * @param i an icon * @param onlyIcon if {@code true} only icon is painted * @param pane an instance of {@code CellRendererPane} * @param list an instance of {@code JList} */ ! public MetalComboBoxButton( JComboBox cb, Icon i, boolean onlyIcon, ! CellRendererPane pane, JList list ) { this( cb, i, pane, list ); iconOnly = onlyIcon; } public boolean isFocusTraversable() { --- 153,164 ---- * @param i an icon * @param onlyIcon if {@code true} only icon is painted * @param pane an instance of {@code CellRendererPane} * @param list an instance of {@code JList} */ ! public MetalComboBoxButton( JComboBox<Object> cb, Icon i, boolean onlyIcon, ! CellRendererPane pane, JList<Object> list ) { this( cb, i, pane, list ); iconOnly = onlyIcon; } public boolean isFocusTraversable() {
*** 236,246 **** return; } // Let the renderer paint if ( ! iconOnly && comboBox != null ) { ! ListCellRenderer renderer = comboBox.getRenderer(); Component c; boolean renderPressed = getModel().isPressed(); c = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1, --- 236,246 ---- return; } // Let the renderer paint if ( ! iconOnly && comboBox != null ) { ! ListCellRenderer<Object> renderer = comboBox.getRenderer(); Component c; boolean renderPressed = getModel().isPressed(); c = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1,