void (final NavBarItem item, boolean checkRepaint) { UIEventLogger.NavBarShowPopup.log(myPanel.getProject()); UISettings settings = UISettings.getInstance(); int relativeY = ExperimentalUI.isNewUI() && settings.getShowNavigationBarInBottom() && settings.getShowStatusBar() ? -getComponent().getPreferredSize().height : item.getHeight(); final RelativePoint point = new RelativePoint(item, new Point(0, relativeY)); final Point p = point.getPoint(myPanel); if ((p.x == 0 || p.y == 0) && checkRepaint) { // need repaint of nav bar panel //noinspection SSBasedInspection SwingUtilities.invokeLater(() -> { myPanel.getUpdateQueue().rebuildUi(); //noinspection SSBasedInspection SwingUtilities.invokeLater(() -> { NavBarItem updatedItem = myPanel.getItemWithObject(item.getObject()); if (updatedItem == null) updatedItem = item; show(updatedItem, false); // end-less loop protection }); }); } else { int offset = NavBarUIManager.getUI().getPopupOffset(item); show(myPanel, p.x - offset, p.y, myPanel, new HintHint(myPanel, p)); final JBList list = getList(); //noinspection HardCodedStringLiteral AccessibleContextUtil.setName(list, item.getText()); if (0 <= myIndex && myIndex < list.getItemsCount()) { ScrollingUtil.selectItem(list, myIndex); } } if (myPanel.isInFloatingMode()) { final Window window = SwingUtilities.windowForComponent(getList()); if (window != null) { // add listener only if hint is not hidden yet window.addWindowFocusListener(new WindowFocusListener() { @Override public void windowGainedFocus(WindowEvent e) { } @Override public void windowLostFocus(WindowEvent e) { final Window w = e.getOppositeWindow(); if (w != null && DialogWrapper.findInstance(w.getComponent(0)) != null) { myPanel.hideHint(); } } }); } } }