void (@NotNull AnActionEvent e) { UsageView usageView = e.getData(UsageView.USAGE_VIEW_KEY); Project project = Objects.requireNonNull(e.getProject()); final FindUsagesManager findUsagesManager = ((FindManagerImpl)FindManager.getInstance(project)).getFindUsagesManager(); List<ConfigurableUsageTarget> history = new ArrayList<>(findUsagesManager.getHistory().getAll()); if (!history.isEmpty()) { // skip most recent find usage, it's under your nose history.remove(history.size() - 1); Collections.reverse(history); } if (history.isEmpty()) { history.add(null); // to fill the popup } BaseListPopupStep<ConfigurableUsageTarget> step = new BaseListPopupStep<>(FindBundle.message("recent.find.usages.action.title"), history) { @Override public Icon getIconFor(final ConfigurableUsageTarget data) { return null; } @Override @NotNull public String getTextFor(final ConfigurableUsageTarget data) { if (data == null) { return FindBundle.message("recent.find.usages.action.nothing"); } return data.getLongDescriptiveName(); } @Override public PopupStep onChosen(final ConfigurableUsageTarget selectedValue, final boolean finalChoice) { return doFinalStep(() -> { if (selectedValue != null) { findUsagesManager.rerunAndRecallFromHistory(selectedValue); } }); } }; JBPopupFactory.getInstance().createListPopup(step).showInCenterOf(usageView.getPreferredFocusableComponent()); }