void (@NotNull AnActionEvent event) { CopyAction.updateWithProvider(event, event.getData(PlatformDataKeys.PASTE_PROVIDER), false, provider -> { boolean isEditorPopup = event.getPlace().equals(ActionPlaces.EDITOR_POPUP); boolean enabled = provider.isPastePossible(event.getDataContext()); event.getPresentation().setEnabled(enabled); event.getPresentation().setVisible(!isEditorPopup || enabled); }); }