src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java

Print this page

        

*** 118,128 **** @Override protected void installDefaults() { updateStyle(comboBox); } ! private void updateStyle(JComboBox comboBox) { SynthStyle oldStyle = style; SynthContext context = getContext(comboBox, ENABLED); style = SynthLookAndFeel.updateStyle(context, this); if (style != oldStyle) { --- 118,128 ---- @Override protected void installDefaults() { updateStyle(comboBox); } ! private void updateStyle(JComboBox<?> comboBox) { SynthStyle oldStyle = style; SynthContext context = getContext(comboBox, ENABLED); style = SynthLookAndFeel.updateStyle(context, this); if (style != oldStyle) {
*** 218,228 **** // but pass in a JTextField instead of JComboBox! In case this // happens, we just return the normal synth state for the component // instead of doing anything special if (!(c instanceof JComboBox)) return SynthLookAndFeel.getComponentState(c); ! JComboBox box = (JComboBox)c; if (shouldActLikeButton()) { int state = ENABLED; if ((!c.isEnabled())) { state = DISABLED; } --- 218,228 ---- // but pass in a JTextField instead of JComboBox! In case this // happens, we just return the normal synth state for the component // instead of doing anything special if (!(c instanceof JComboBox)) return SynthLookAndFeel.getComponentState(c); ! JComboBox<?> box = (JComboBox)c; if (shouldActLikeButton()) { int state = ENABLED; if ((!c.isEnabled())) { state = DISABLED; }
*** 261,271 **** /** * {@inheritDoc} */ @Override ! protected ListCellRenderer createRenderer() { return new SynthComboBoxRenderer(); } /** * {@inheritDoc} --- 261,271 ---- /** * {@inheritDoc} */ @Override ! protected ListCellRenderer<Object> createRenderer() { return new SynthComboBoxRenderer(); } /** * {@inheritDoc}
*** 370,380 **** /** * Paints the currently selected item. */ @Override public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus) { ! ListCellRenderer renderer = comboBox.getRenderer(); Component c; c = renderer.getListCellRendererComponent( listBox, comboBox.getSelectedItem(), -1, false, false ); --- 370,380 ---- /** * Paints the currently selected item. */ @Override public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus) { ! ListCellRenderer<Object> renderer = comboBox.getRenderer(); Component c; c = renderer.getListCellRendererComponent( listBox, comboBox.getSelectedItem(), -1, false, false );
*** 708,722 **** /** * Handler for repainting combo when editor component gains/looses focus */ private static class EditorFocusHandler implements FocusListener, PropertyChangeListener { ! private JComboBox comboBox; private ComboBoxEditor editor = null; private Component editorComponent = null; ! private EditorFocusHandler(JComboBox comboBox) { this.comboBox = comboBox; editor = comboBox.getEditor(); if (editor != null){ editorComponent = editor.getEditorComponent(); if (editorComponent != null){ --- 708,722 ---- /** * Handler for repainting combo when editor component gains/looses focus */ private static class EditorFocusHandler implements FocusListener, PropertyChangeListener { ! private JComboBox<?> comboBox; private ComboBoxEditor editor = null; private Component editorComponent = null; ! private EditorFocusHandler(JComboBox<?> comboBox) { this.comboBox = comboBox; editor = comboBox.getEditor(); if (editor != null){ editorComponent = editor.getEditorComponent(); if (editorComponent != null){