void (AnActionButton button) { RelativePoint point = button.getPreferredPopupPoint(); JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<>(null, JsonMappingKind.values()) { @Override public @NotNull String getTextFor(JsonMappingKind value) { return JsonBundle.message("schema.add.mapping.kind.text", StringUtil.capitalizeWords(value.getDescription(), true)); } @Override public Icon getIconFor(JsonMappingKind value) { return value.getIcon(); } @Override public PopupStep onChosen(JsonMappingKind selectedValue, boolean finalChoice) { if (finalChoice) { return doFinalStep(() -> doRun(selectedValue)); } return PopupStep.FINAL_CHOICE; } }).show(point); }