private void registerListeners() {
    if (!(myListPopup instanceof ListPopupImpl listPopupImpl)) {
      return;
    }
    JList<?> list = listPopupImpl.getList();
    list.addFocusListener(new FocusListener() {
      @Override
      public void focusGained(FocusEvent e) {
        if (EditorSettingsExternalizable.getInstance().isShowIntentionPreview()) {
          showPreview();
        }
      }

      @Override
      public void focusLost(FocusEvent e) {
        if (EditorSettingsExternalizable.getInstance().isShowIntentionPreview()) {
          myProcessor.hide();
        }
      }
    });
    myListPopup.addListener(new JBPopupListener() {
      @Override
      public void onClosed(@NotNull LightweightWindowEvent event) {
        myProcessor.hide();
      }
    });
    list.getModel().addListDataListener(new ListDataListener() {
      @Override
      public void intervalAdded(ListDataEvent e) {
        update(list);
      }

      @Override
      public void intervalRemoved(ListDataEvent e) {
        update(list);
      }

      @Override
      public void contentsChanged(ListDataEvent e) {
        update(list);
      }
    });
    myListPopup.addListSelectionListener(e -> {
      update(list);
    });
  }
private void registerListeners()