public void selectListIndex() { if (itemList != null && itemList.getSelectedIndex() != -1) { listItemSelected((String) itemList.getSelectedValue()); } // don't show popup anymore autoComplete.hidePopup(); // move caret to position after replaced text autoComplete.setCaretToDesiredPosition(); // reset selected index selectedIndex = -1; }
private void listItemSelected(String item) { if (item == null) { return; } autoComplete.replaceWithPopupItem(item); }
public void selectListIndexKeyEntry() { if (selectedIndex >= 0) { if (itemList != null && itemList.getModel().getSize() > 0) { listItemSelected((String) itemList.getModel().getElementAt(selectedIndex)); } } // don't show popup anymore autoComplete.hidePopup(); // move caret to position after replaced text autoComplete.setCaretToDesiredPosition(); // reset selected index selectedIndex = -1; }
public FieldPopup(AutoCompleteField parent) { this.autoComplete = parent; if (autoComplete != null) { this.fontSize = autoComplete.getFont().getSize2D(); } selectedIndex = -1; setLayout(new BorderLayout()); }