/** Overridden to return the combo box's background color if selected * and focused - in GTK L&F combo boxes are always white (there's even * a "fixme" note in the code. */ public Color getBackground() { //This method can be called in the superclass constructor, thanks //to updateUI(). At that time, this==null, so an NPE would happen //if we tried tor reference the outer class if (ComboInplaceEditor.this == null) { return null; } if (!sel && (getText() != null && getSelectedItem() != null && getText().equals(getSelectedItem()))) { return ComboInplaceEditor.this.getBackground(); } else { return super.getBackground(); } }
/** Overridden to return the combo box's background color if selected * and focused - in GTK L&F combo boxes are always white (there's even * a "fixme" note in the code. */ public Color getBackground() { //This method can be called in the superclass constructor, thanks //to updateUI(). At that time, this==null, so an NPE would happen //if we tried tor reference the outer class if (ComboInplaceEditor.this == null) { return null; } if (!sel && (getText() != null && getSelectedItem() != null && getText().equals(getSelectedItem()))) { return ComboInplaceEditor.this.getBackground(); } else { return super.getBackground(); } }
public Object getValue() { if (isEditable()) { return getEditor().getItem(); } else { return getSelectedItem(); } }
public Object getValue() { if (isEditable()) { return getEditor().getItem(); } else { return getSelectedItem(); } }
@Override public Object getValue() { if (isEditable()) { if( isAutoComplete ) { Object editorItem = getEditor().getItem(); if( null != editorItem ) { int selItem = ComboBoxAutoCompleteSupport.findMatch( this, editorItem.toString() ); if( selItem >= 0 && selItem < getItemCount() ) return getItemAt( selItem ); if( strictAutoCompleteMatching ) return getSelectedItem(); } } return getEditor().getItem(); } else { return getSelectedItem(); } }