void () { final boolean active = ApplicationManager.getApplication().isActive(); if (!active) { return; } if (myAlarm.isEmpty()) { myAlarm.addRequest(() -> { Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(myComponent.get())); if (project == null) return; UIEventLogger.ToolWindowsWidgetPopupShown.log(project); List<ToolWindow> toolWindows = new ArrayList<>(); ToolWindowManagerImpl toolWindowManager = (ToolWindowManagerImpl)ToolWindowManager.getInstance(project); for (ToolWindow toolWindow : toolWindowManager.getToolWindows()) { if (toolWindow.isAvailable() && toolWindow.isShowStripeButton()) { toolWindows.add(toolWindow); } } toolWindows.sort((o1, o2) -> StringUtil.naturalCompare(o1.getStripeTitle(), o2.getStripeTitle())); JBList<ToolWindow> list = new JBList<>(toolWindows); list.setCellRenderer(new ToolWindowsWidgetCellRenderer()); final Dimension size = list.getPreferredSize(); final JComponent c = myComponent.get(); final Insets padding = UIUtil.getListViewportPadding(false); final RelativePoint point = new RelativePoint(c, new Point(-4, -padding.top - padding.bottom -4 - size.height + (SystemInfo.isMac ? 2 : 0))); if (popup != null && popup.isVisible()) { return; } list.setSelectedIndex(list.getItemsCount() - 1); PopupChooserBuilder<ToolWindow> builder = JBPopupFactory.getInstance().createListPopupBuilder(list); popup = builder .setAutoselectOnMouseMove(true) .setRequestFocus(false) .setItemChosenCallback((selectedValue) -> { if (popup != null) popup.closeOk(null); toolWindowManager.activateToolWindow(selectedValue.getId(), null, true, ToolWindowEventSource.ToolWindowsWidget); }) .createPopup(); list.setVisibleRowCount(30); // override default of 15 set when createPopup() is called popup.show(point); }, 300); } }