void (@Nullable SearchPopup searchPopup) { Project project = null; if (ApplicationManager.getApplication() != null && !ApplicationManager.getApplication().isDisposed()) { project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(myComponent)); } if (project != null && project.isDefault()) { project = null; } if (mySearchPopup != null) { UIEventLogger.IncrementalSearchCancelled.log(project, myComponent.getClass()); if (myPopupLayeredPane != null) { myPopupLayeredPane.remove(mySearchPopup); myPopupLayeredPane.validate(); myPopupLayeredPane.repaint(); myPopupLayeredPane = null; } if (myListenerDisposable != null) { Disposer.dispose(myListenerDisposable); myListenerDisposable = null; } if (isStickySearch()) { myComponent.putClientProperty(SEARCH_TEXT_KEY, Strings.nullize(getEnteredPrefix())); } } else if (searchPopup != null) { FeatureUsageTracker.getInstance().triggerFeatureUsed("ui.tree.speedsearch"); UIEventLogger.IncrementalSearchActivated.log(project, myComponent.getClass()); } mySearchPopup = myComponent.isShowing() ? searchPopup : null; fireStateChanged(); //select here! if (mySearchPopup == null || !myComponent.isDisplayable()) return; if (project != null) { myListenerDisposable = Disposer.newDisposable(); project.getMessageBus().connect(myListenerDisposable).subscribe(ToolWindowManagerListener.TOPIC, myWindowManagerListener); } JRootPane rootPane = myComponent.getRootPane(); myPopupLayeredPane = rootPane == null ? null : rootPane.getLayeredPane(); if (myPopupLayeredPane == null) { LOG.error(this + " in " + myComponent); return; } myPopupLayeredPane.add(mySearchPopup, JLayeredPane.POPUP_LAYER); moveSearchPopup(); }