void (final @NotNull AnActionEvent e) { final Project project = e.getProject(); if (project == null || project.isDisposed()) return; final Ref<Pair<? extends JComponent, String>> stateRef = new Ref<>(); final Ref<Balloon> balloonRef = new Ref<>(); final Timer timer = TimerUtil.createNamedTimer("runningLists", 250); ActionListener actionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { Balloon balloon = balloonRef.get(); if (project.isDisposed() || (balloon != null && balloon.isDisposed())) { timer.stop(); return; } ArrayList<Project> projects = new ArrayList<>(Arrays.asList(ProjectManager.getInstance().getOpenProjects())); //List should begin with current project projects.remove(project); projects.add(0, project); Pair<? extends JComponent, String> state = getCurrentState(projects); Pair<? extends JComponent, String> prevState = stateRef.get(); if (prevState != null && prevState.getSecond().equals(state.getSecond())) return; stateRef.set(state); BalloonBuilder builder = JBPopupFactory.getInstance().createBalloonBuilder(state.getFirst()); builder.setShowCallout(false) .setTitle(ExecutionBundle.message("show.running.list.balloon.title")) .setBlockClicksThroughBalloon(true) .setDialogMode(true) .setHideOnKeyOutside(false); IdeFrame frame = e.getData(IdeFrame.KEY); if (frame == null) { frame = WindowManagerEx.getInstanceEx().getFrameHelper(project); } if (balloon != null) { balloon.hide(); } builder.setClickHandler(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (e.getSource() instanceof MouseEvent mouseEvent) { Component component = mouseEvent.getComponent(); component = SwingUtilities.getDeepestComponentAt(component, mouseEvent.getX(), mouseEvent.getY()); Object value = ((JComponent)component).getClientProperty(KEY); if (value instanceof Trinity) { Project aProject = (Project)((Trinity<?, ?, ?>)value).first; JFrame aFrame = WindowManager.getInstance().getFrame(aProject); if (aFrame != null && !aFrame.isActive()) { IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> { IdeFocusManager.getGlobalInstance().requestFocus(aFrame, true); }); } RunContentManager.getInstance(aProject). toFrontRunContent((Executor)((Trinity<?, ?, ?>)value).second, (RunContentDescriptor)((Trinity<?, ?, ?>)value).third); } } } }, false); balloon = builder.createBalloon(); balloonRef.set(balloon); JComponent component = frame.getComponent(); RelativePoint point = new RelativePoint(component, new Point(component.getWidth(), 0)); balloon.show(point, Balloon.Position.below); } }; timer.addActionListener(actionListener); timer.setInitialDelay(0); timer.start(); }