JBPopup (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) project = ProjectManager.getInstance().getDefaultProject(); Ref<JBPopup> popup = new Ref<>(); MyChangesBrowser cb = new MyChangesBrowser(project, popup); popup.set(JBPopupFactory.getInstance() .createComponentPopupBuilder(cb, cb.getPreferredFocusedComponent()) .setResizable(true) .setModalContext(false) .setFocusable(true) .setRequestFocus(true) .setCancelOnWindowDeactivation(true) .setCancelOnOtherWindowOpen(true) .setMovable(true) .setCancelKeyEnabled(true) .setCancelOnClickOutside(true) .setDimensionServiceKey(project, "Diff.GoToChangePopup", false) .addListener(new JBPopupListener() { @Override public void onClosed(@NotNull LightweightWindowEvent event) { cb.shutdown(); } }) .createPopup()); return popup.get(); }