@Nullable @Override public final ShortcutSet getShortcut(@NotNull DataContext context) { SearchSession search = SearchSession.KEY.getData(context); boolean singleLine = search != null && !search.getFindModel().isMultiline(); return Utils.shortcutSetOf( singleLine ? ContainerUtil.concat(getDefaultShortcuts(), getSingleLineShortcuts()) : getDefaultShortcuts()); }
@Override public final void update(AnActionEvent e) { SearchSession search = e.getData(SearchSession.KEY); e.getPresentation().setEnabled(search != null && search.hasMatches()); }