void (@NotNull final AnActionEvent e) { Project project = e.getProject(); if (project == null) { e.getPresentation().setEnabledAndVisible(false); return; } ThumbnailView view = ThumbnailViewActionUtil.getVisibleThumbnailView(e); ImageTagManager tagManager = ImageTagManager.getInstance(project); e.getPresentation().setVisible(view != null && !tagManager.getAllTags().isEmpty()); TagFilter[] filters = view != null ? view.getTagFilters() : null; e.getPresentation().setText(filters == null ? CommonBundle.message("action.text.all") : StringUtil.join(filters, filter -> filter.getDisplayName(), ",")); e.getPresentation().setIcon(AllIcons.Duplicates.SendToTheRight); }