Beispiel #1
0
  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;
  }
Beispiel #2
0
  private void listItemSelected(String item) {
    if (item == null) {
      return;
    }

    autoComplete.replaceWithPopupItem(item);
  }
Beispiel #3
0
  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;
  }
Beispiel #4
0
  public FieldPopup(AutoCompleteField parent) {
    this.autoComplete = parent;

    if (autoComplete != null) {
      this.fontSize = autoComplete.getFont().getSize2D();
    }

    selectedIndex = -1;

    setLayout(new BorderLayout());
  }