void (final Callback callback, final ModalityState modalityState, boolean allowMultipleSelection) { super.initUI(callback, modalityState, allowMultipleSelection); if (myOldPopup != null) { myTextField.setCaretPosition(myOldPopup.myTextField.getCaretPosition()); } if (myInitialText != null) { int selStart = myOldPopup == null ? 0 : myOldPopup.myTextField.getSelectionStart(); int selEnd = myOldPopup == null ? myInitialText.length() : myOldPopup.myTextField.getSelectionEnd(); if (selEnd > selStart) { myTextField.select(selStart, selEnd); } rebuildList(SelectionPolicyKt.fromIndex(myInitialIndex), 0, ModalityState.current(), null); } if (myOldFocusOwner != null) { myPreviouslyFocusedComponent = myOldFocusOwner; myOldFocusOwner = null; } if (myInputMap != null && myActionMap != null) { for (KeyStroke keyStroke : myInputMap.keys()) { Object key = myInputMap.get(keyStroke); myTextField.getInputMap().put(keyStroke, key); myTextField.getActionMap().put(key, myActionMap.get(key)); } } }