void (AnActionButton anActionButton) { DefaultActionGroup group = new DefaultActionGroup(); for (AnAction aMyAdditional : createActions) { group.add(aMyAdditional); } Set<TaskRepository> repositories = RecentTaskRepositories.getInstance().getRepositories(); myRepositories.forEach(repositories::remove); if (!repositories.isEmpty()) { group.add(Separator.getInstance()); for (final TaskRepository repository : repositories) { group.add(new AddServerAction(repository) { @Override protected TaskRepository getRepository() { return repository; } }); } } JBPopupFactory.getInstance() .createActionGroupPopup(TaskBundle.message("popup.title.add.server"), group, DataManager.getInstance().getDataContext(anActionButton.getContextComponent()), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true).show( anActionButton.getPreferredPopupPoint()); }