|
|
|
@ -55,15 +55,19 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void setSelectedItem(Object anObject) { |
|
|
|
|
initialSelected = anObject; |
|
|
|
|
if (loaded) { |
|
|
|
|
super.setSelectedItem(anObject); |
|
|
|
|
} else { |
|
|
|
|
if (initialSelected == null) { |
|
|
|
|
this.setModel(new DefaultComboBoxModel<>(new Object[]{anObject})); |
|
|
|
|
} |
|
|
|
|
this.setModel(new DefaultComboBoxModel<>(new Object[]{anObject})); |
|
|
|
|
super.setSelectedItem(anObject); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setSelectedItemWithDocumentChange(Object anObject) { |
|
|
|
|
initialSelected = anObject; |
|
|
|
|
super.setSelectedItem(anObject); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -185,7 +189,7 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
|
|
|
|
|
} |
|
|
|
|
filtering = true; |
|
|
|
|
String xx = textField.getText(); |
|
|
|
|
LazyComboBox.this.setSelectedItem(xx); |
|
|
|
|
LazyComboBox.this.setSelectedItemWithDocumentChange(xx); |
|
|
|
|
this.item = textField.getText(); |
|
|
|
|
|
|
|
|
|
setPopupVisible(true); |
|
|
|
|